⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zjc.frm

📁 企业管理系统,用ACESS2000的数据库系统和ADO连接接口
💻 FRM
字号:
VERSION 5.00
Begin VB.Form zczj 
   Caption         =   "中级职称工资标准"
   ClientHeight    =   5670
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8310
   LinkTopic       =   "Form2"
   ScaleHeight     =   5670
   ScaleWidth      =   8310
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command3 
      Caption         =   "确定"
      Height          =   615
      Left            =   1800
      TabIndex        =   12
      Top             =   4560
      Width           =   1455
   End
   Begin VB.CommandButton Command2 
      Caption         =   "返回"
      Height          =   615
      Left            =   5160
      TabIndex        =   11
      Top             =   4560
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修改"
      Height          =   615
      Left            =   3480
      TabIndex        =   10
      Top             =   4560
      Width           =   1215
   End
   Begin VB.TextBox Text5 
      Height          =   735
      Left            =   6480
      TabIndex        =   9
      Text            =   "Text5"
      Top             =   3000
      Width           =   1455
   End
   Begin VB.TextBox Text4 
      Height          =   735
      Left            =   6480
      TabIndex        =   8
      Text            =   "Text4"
      Top             =   2040
      Width           =   1455
   End
   Begin VB.TextBox Text3 
      Height          =   735
      Left            =   6480
      TabIndex        =   7
      Text            =   "Text3"
      Top             =   1080
      Width           =   1455
   End
   Begin VB.TextBox Text2 
      Height          =   735
      Left            =   2520
      TabIndex        =   6
      Text            =   "Text2"
      Top             =   2040
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      Height          =   735
      Left            =   2520
      TabIndex        =   5
      Text            =   "Text1"
      Top             =   1080
      Width           =   1455
   End
   Begin VB.Label Label6 
      Caption         =   "中级职称工资标准"
      Height          =   615
      Left            =   1440
      TabIndex        =   13
      Top             =   600
      Width           =   3255
   End
   Begin VB.Label Label5 
      Caption         =   "备注:"
      Height          =   615
      Left            =   5280
      TabIndex        =   4
      Top             =   3240
      Width           =   975
   End
   Begin VB.Label Label4 
      Caption         =   "工龄工资:"
      Height          =   495
      Left            =   5280
      TabIndex        =   3
      Top             =   2280
      Width           =   975
   End
   Begin VB.Label Label3 
      Caption         =   "职务工资:"
      Height          =   495
      Left            =   5280
      TabIndex        =   2
      Top             =   1320
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "职称工资:"
      Height          =   615
      Left            =   1440
      TabIndex        =   1
      Top             =   2280
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "基本工资:"
      Height          =   495
      Left            =   1440
      TabIndex        =   0
      Top             =   1320
      Width           =   975
   End
End
Attribute VB_Name = "zczj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit
Private Conn As ADODB.Connection
Private Rst As New ADODB.Recordset

Private Sub Command1_Click()
Command3.Visible = True
 Command1.Visible = False
 Text1.Enabled = True
    Text2.Enabled = True
    Text3.Enabled = True
    Text4.Enabled = True
    Text5.Enabled = True
End Sub

Private Sub Command2_Click()
Form1.Show
Unload Me
End Sub

Private Sub Command3_Click()

Command1.Visible = False
On Error Resume Next


    If (Rst.State = adStateOpen) Then
        Rst.Close
    End If
    Rst.CursorLocation = adUseClient
    Rst.Open "Select * From bzj", Conn, adOpenKeyset, adLockPessimistic
    Rst.Delete
    Rst.AddNew
    Rst.Fields("jbgz").Value = Text1.Text
    Rst.Fields("zcgz").Value = Text2.Text
    Rst.Fields("zwgz").Value = Text3.Text
    Rst.Fields("glgz").Value = Text4.Text
    Rst.Fields("bz").Value = Text5.Text
    
    Rst.Update
    MsgBox "修改成功!"

Command1.Visible = True
Command3.Visible = False
End Sub

Private Sub Form_Load()
   
    Text1.Enabled = False
    Text2.Enabled = False
    Text3.Enabled = False
    Text4.Enabled = False
    Text5.Enabled = False
    Command3.Visible = False
    
    
    
    Dim ConString As String
    ConString = "Provider=Microsoft.Jet.OleDb.4.0;Persist Security Info = False;" _
               & "Data Source =" & App.Path & "\db1.mdb;Jet OleDb:DataBase Password=123456"

    
    Set Conn = CreateObject("ADODB.Connection")
    With Conn
        .ConnectionString = ConString
        .Open
    End With
    
    If (Rst.State = adStateOpen) Then
        Rst.Close
    End If
    
    Rst.CursorLocation = adUseClient
    Rst.Open "Select * From bzj", Conn, adOpenKeyset, adLockPessimistic, adCmdText
    
    If Rst.RecordCount > 0 Then
     Text1.Text = Rst.Fields("jbgz").Value
    Text2.Text = Rst.Fields("zcgz").Value
    Text3.Text = Rst.Fields("zwgz").Value
    Text4.Text = Rst.Fields("glgz").Value
    Text5.Text = Rst.Fields("bz").Value
    Else
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -