📄 用户登陆.frm
字号:
VERSION 5.00
Begin VB.Form denglu1
Caption = "用户登陆"
ClientHeight = 3300
ClientLeft = 60
ClientTop = 450
ClientWidth = 5355
ControlBox = 0 'False
LinkTopic = "Form2"
Picture = "用户登陆.frx":0000
ScaleHeight = 3300
ScaleMode = 0 'User
ScaleWidth = 5355
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3000
MaskColor = &H000000C0&
Picture = "用户登陆.frx":1D5BF
TabIndex = 5
Top = 2520
Width = 855
End
Begin VB.CommandButton Command1
BackColor = &H80000016&
Caption = "登 陆"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 4
Top = 2520
Width = 855
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 2
Top = 1785
Width = 1455
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 270
Left = 2400
TabIndex = 0
Top = 1065
Width = 1455
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "招生管理系统"
BeginProperty Font
Name = "楷体_GB2312"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 495
Left = 1200
TabIndex = 6
Top = 240
Width = 2970
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 码"
BeginProperty Font
Name = "华文宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 270
Left = 1440
TabIndex = 3
Top = 1800
Width = 735
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名"
BeginProperty Font
Name = "华文宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 270
Left = 1440
TabIndex = 1
Top = 1080
Width = 765
End
End
Attribute VB_Name = "denglu1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs_user As New ADODB.Recordset
Private Sub Command1_Click()
Dim sqluser As String
'构造查询该用户名和密码的sql语句
sqluser = "select * from 用户 where 用户名 = '" & Text1.Text & "' and 密码 = '" & Text2.Text & "'"
rs_user.Open sqluser, conn, adOpenKeyset, adLockPessimistic
If rs_user.EOF = True Then
MsgBox "用户名和密码不正确!", vbOKOnly + vbExclamation, "注意"
rs_user.Close
Exit Sub
'End If
'If rs_user.EOF = True Then
'MsgBox "用户名和密码不正确!", vbOKOnly + vbInformation, "注意"
Else
Form1.Show
rs_user.Close
Unload denglu1
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
conn.Open "DSN=招生管理系统_Data;userID=sa"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -