📄 main_czysz.frm
字号:
VERSION 5.00
Begin VB.Form main_czysz
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "操作员设置"
ClientHeight = 3240
ClientLeft = 45
ClientTop = 330
ClientWidth = 6120
Icon = "main_czysz.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3240
ScaleWidth = 6120
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdcancel
BackColor = &H00C0C0C0&
Caption = "取消"
Height = 375
Left = 2205
Style = 1 'Graphical
TabIndex = 8
Top = 2760
Width = 1575
End
Begin VB.CommandButton cmdok
BackColor = &H00C0C0C0&
Caption = "确定"
Height = 375
Left = 480
Style = 1 'Graphical
TabIndex = 7
Top = 2760
Width = 1575
End
Begin VB.CommandButton cmdquit
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 375
Left = 3960
Style = 1 'Graphical
TabIndex = 6
Top = 2760
Width = 1575
End
Begin VB.Frame Frame1
Height = 2625
Left = 105
TabIndex = 0
Top = 75
Width = 5745
Begin VB.TextBox txtczy
BackColor = &H00FFFFFF&
Height = 345
Left = 2010
TabIndex = 3
Top = 1020
Width = 2880
End
Begin VB.TextBox txtpwd
BackColor = &H00FFFFFF&
Height = 345
IMEMode = 3 'DISABLE
Left = 2010
MaxLength = 6
TabIndex = 2
Top = 1545
Width = 2880
End
Begin VB.TextBox txtqrpwd
BackColor = &H00FFFFFF&
Height = 360
IMEMode = 3 'DISABLE
Left = 2010
MaxLength = 6
PasswordChar = "*"
TabIndex = 1
Top = 2070
Width = 2880
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "请输入操作员代号和密码"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 150
TabIndex = 5
Top = 210
Width = 5100
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "操作员 密 码 确 认"
Height = 1395
Left = 1395
TabIndex = 4
Top = 1080
Width = 1005
End
End
End
Attribute VB_Name = "main_czysz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DBcnn As New ADODB.Connection
Dim DBrs As New ADODB.Recordset
Private Sub Form_Load()
'Data1.DatabaseName = App.Path & "\KFGL.MDB" '自动识别数据库路径
End Sub
Private Sub Form_Activate()
txtczy.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True
End Sub
Private Sub txtczy_KeyDown(KeyCode As Integer, Shift As Integer)
'回车txtpwd获得焦点
If KeyCode = vbKeyReturn Then txtpwd.SetFocus
End Sub
Private Sub txtpwd_KeyDown(KeyCode As Integer, Shift As Integer)
'回车txtqrpwd获得焦点
If KeyCode = vbKeyReturn Then txtqrpwd.SetFocus
End Sub
Private Sub txtqrpwd_KeyDown(KeyCode As Integer, Shift As Integer)
'回车cmdok获得焦点
If KeyCode = vbKeyReturn Then cmdok.SetFocus
End Sub
Private Sub cmdok_Click()
If DBcnn.State = 0 Then
Dim connectstr As String
connectstr = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _
App.Path & "\KFGL.mdb;Persist Security Info=False"
DBcnn.CursorLocation = adUseClient
DBcnn.Open connectstr
End If
If DBrs.State = 1 Then
DBrs.Close
End If
'保存操作员及密码
If txtczy.Text <> "" Then
If txtpwd.Text <> "" Then
Dim sqlstr As String
sqlstr = "insert into qxsz (操作员,密码) values ('" & txtczy.Text & "','" & txtpwd.Text & "')"
DBcnn.Execute sqlstr
txtczy.Text = ""
txtpwd.Text = ""
txtqrpwd.Text = ""
MsgBox ("操作员设置成功!")
End If
Else
MsgBox ("请输入操作员!")
End If
End Sub
Private Sub cmdcancel_Click()
txtczy.Text = ""
txtpwd.Text = ""
txtqrpwd.Text = ""
End Sub
Private Sub cmdquit_Click()
main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -