📄 form9.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
Caption = "Form1"
ClientHeight = 5055
ClientLeft = 60
ClientTop = 450
ClientWidth = 6330
LinkTopic = "from1"
ScaleHeight = 5055
ScaleWidth = 6330
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 3600
TabIndex = 7
Top = 3960
Width = 1695
End
Begin VB.CommandButton cmdLogin
Caption = "登录"
Height = 375
Left = 840
TabIndex = 6
Top = 3960
Width = 1455
End
Begin VB.Frame Frame1
Height = 2175
Left = 360
TabIndex = 0
Top = 1560
Width = 5535
Begin VB.TextBox txtPwd
Height = 285
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 5
Top = 1200
Width = 2295
End
Begin VB.TextBox txtUser
Height = 285
Left = 2160
TabIndex = 3
Top = 720
Width = 2295
End
Begin VB.Label Label3
Caption = "用户密码"
Height = 255
Left = 600
TabIndex = 4
Top = 1320
Width = 1335
End
Begin VB.Label Label2
Caption = "用户名称"
Height = 400
Left = 720
TabIndex = 2
Top = 720
Width = 1095
End
End
Begin VB.Label label1
Caption = " 销售管理信息系统"
Height = 615
Left = 480
TabIndex = 1
Top = 720
Width = 5415
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdLogin_Click()
If txtUser.Text = "" Then
MsgBox "请填入用户姓名!", vbOKOnly + vbInformation, "注意"
txtUser.SetFocus
Exit Sub
ElseIf txtPwd.Text = "" Then
MsgBox "请填入用户密码!", vbOKOnly + vbInformation, "注意"
txtPwd.SetFocus
Exit Sub
End If
Dim rstUser As New ADODB.Recordset
Dim sql As String
sql = "select * from userdb where 用户名='" & txtUser.Text & "'and " & "密码='" & txtPwd.Text & "'"
rstUser.Open sql, conn, adOpenDynamic, adLockPessimistic
If rstUser.EOF = True Then
MsgBox "用户名或密码错误,无法登录", vbOKOnly + vbExclamation, ""
rstUser.Close
Exit Sub
Else
MsgBox "正确登录", vbOKOnly + vbExclamation, ""
MDIfrmMain.mnchpwd.Enabled = True
MDIfrmMain.mntrade.Enabled = True
MDIfrmMain.mnbuy.Enabled = True
MDIfrmMain.mnsell.Enabled = True
MDIfrmMain.mngrade.Enabled = True
MDIfrmMain.mntable.Enabled = True
rstUser.Close
Unload Me
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -