📄 jmpa_login.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登录"
ClientHeight = 1965
ClientLeft = 2835
ClientTop = 3480
ClientWidth = 3750
Icon = "JmPa_Login.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1160.987
ScaleMode = 0 'User
ScaleWidth = 3521.047
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox Combo2
Height = 300
Left = 1320
TabIndex = 7
Text = "Combo2"
Top = 960
Width = 2295
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 6
Top = 120
Width = 2295
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 3360
Top = 1440
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 390
Left = 495
TabIndex = 3
Top = 1440
Width = 1140
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 390
Left = 2100
TabIndex = 4
Top = 1440
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 300
IMEMode = 3 'DISABLE
Left = 1290
PasswordChar = "*"
TabIndex = 2
Top = 525
Width = 2295
End
Begin VB.Label Label1
Caption = "账套:"
Height = 255
Left = 120
TabIndex = 5
Top = 960
Width = 975
End
Begin VB.Label lblLabels
Caption = "用户名称:"
Height = 270
Index = 0
Left = 105
TabIndex = 0
Top = 150
Width = 1080
End
Begin VB.Label lblLabels
Caption = "密码:"
Height = 270
Index = 1
Left = 105
TabIndex = 1
Top = 540
Width = 1080
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()
End
End Sub
Sub fpwok() '验证登录
Dim fpwsql As String
Set fpwokstring = CreateObject("adodb.connection")
fpwokstring.Open connstring
fpwsql = "select * from Pa_user where fusername=" & "'" & Combo1.Text & "'"
Set rs_fpwok = fpwokstring.Execute(fpwsql)
If rs_fpwok.EOF <> True Then
If txtPassword = rs_fpwok.Fields!fpw Then
Unload Me
Form1.Show
Else
MsgBox "密码错误,请重新输出或[取消]退出!", vbOKOnly + vbInformation, "登录"
End If
Else
MsgBox "请正确选择用户名称!", vbOKOnly + vbInformation, "用户"
End If
rs_fpwok.Close
fpwokstring.Close
End Sub
Private Sub cmdOK_Click()
Call fpwok
End Sub
Private Sub Form_Load()
Dim i As Integer
i = 0
connstring = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\Jmpadata.mdb"
Set fpwstring = CreateObject("adodb.connection")
fpwstring.Open connstring
Set rs_fpwset = fpwstring.Execute("select * from Pa_set")
Set rs_fuser = fpwstring.Execute("select * from Pa_user")
'Combo1.Text = ""
Do While rs_fuser.EOF <> True
Combo1.AddItem rs_fuser.Fields!fusername, i
rs_fuser.MoveNext
i = i + 1
Loop
Combo2.Text = rs_fpwset.Fields!fpath
rs_fuser.Close
rs_fpwset.Close
fpwstring.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -