【VB开源代码栏目提醒】:网学会员在VB开源代码频道为大家收集整理了user_login.frm提供大家参考,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form user_login
Caption = "用户
登陆"
ClientHeight = 2490
ClientLeft = 60
ClientTop = 345
ClientWidth = 6075
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 2490
ScaleWidth = 6075
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3240
TabIndex = 5
Top = 1800
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 1560
TabIndex = 4
Top = 1800
Width = 975
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 2760
Pass
wordChar = "*"
TabIndex = 3
Top = 1080
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 2760
TabIndex = 1
Top = 360
Width = 1815
End
Begin
VB.Label Label2
Caption = "密 码:"
Height = 495
Left = 840
TabIndex = 2
Top = 1080
Width = 1455
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 375
Left = 840
TabIndex = 0
Top = 360
Width = 1455
End
End
Attribute VB_Name = "user_login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sql As Variant
Private Sub Command1_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_user where uname='" & Text1.Text & "'"
rs.Open sql, cn, 1, 1
If rs.EOF = True Then
MsgBox "该用户名不存在", vbOKCancel + 48, "考试管理
系统"
Else
If rs("upass") = Trim(Text2.Text) Then
main.Show
Unload Me
Else
MsgBox "密码输入错误", vbOKCancel + 48, "考试
管理系统"
Text2.Text = ""
Text2.SetFocus
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub