📄 登陆.frm
字号:
VERSION 5.00
Begin VB.Form 登陆
Caption = "登陆"
ClientHeight = 1770
ClientLeft = 60
ClientTop = 345
ClientWidth = 4920
LinkTopic = "Form2"
ScaleHeight = 1770
ScaleWidth = 4920
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command_登陆
Caption = "登陆"
Height = 495
Left = 3600
TabIndex = 4
Top = 600
Width = 975
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 1
Top = 960
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
Left = 1200
TabIndex = 0
Top = 360
Width = 1935
End
Begin VB.Label Label2
Caption = "密码"
Height = 375
Left = 600
TabIndex = 3
Top = 960
Width = 495
End
Begin VB.Label Label1
Caption = "帐号"
Height = 375
Left = 600
TabIndex = 2
Top = 360
Width = 495
End
End
Attribute VB_Name = "登陆"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command_登陆_Click()
'rs As ADODB.Recordset
' New ADODB.Recordset
登陆帐号 = Text1.Text
登陆密码 = Text2.Text
sqlstring = "select 帐号密码 from 帐号表 where 帐号表.帐号= '" + 登陆帐号 + "'"
Set rs = New ADODB.Recordset
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\通讯录.mdb;Persist Security Info=False"
conn.Open
rs.Open sqlstring, conn
If rs.EOF Then
MsgBox ("帐号错误或不存在,请重新输入!")
Text1.Text = ""
Text2.Text = ""
Else
If 登陆密码 = rs.Fields("帐号密码").Value Then
Unload Me
MDI主窗体.Show
Else
MsgBox ("密码错误,请重新输入!")
Text2.Text = ""
End If
End If
If rs.State = 1 Then
rs.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -