Option Explicit
Const mxlogintimes As Integer = 3
Private Sub cmdlogin_Click()
Dim cn As Connection
Dim rs As Recordset
Set cn = New Connection
Set rs = New Recordset
cn.ConnectionString = "provider=microsoft.jet OLEDB.3.51;data source=c:\users\jf\desktop\textexample.mdb"
cn.Open
rs.ActiveConnection = cn
Dim strsql As String
strsql = "select userpassword from userinformation where UserID='" & Me.txtUserID & "'"
rs.Open (strsql)
If rs.EOF Then
MsgBox "用户名不存在", vbCritical, "denglu"
Else
If rs.Fields("userpaddword").Value <> Me.txtuserpassword Then
MsgBox "mimacuo"
Else
MsgBox "success"
Unload Me
Form2.Show
End If
End If
cn.Close
Set cn = Nothing
Set rs = Nothing
ppp:
End Sub
Const mxlogintimes As Integer = 3
Private Sub cmdlogin_Click()
Dim cn As Connection
Dim rs As Recordset
Set cn = New Connection
Set rs = New Recordset
cn.ConnectionString = "provider=microsoft.jet OLEDB.3.51;data source=c:\users\jf\desktop\textexample.mdb"
cn.Open
rs.ActiveConnection = cn
Dim strsql As String
strsql = "select userpassword from userinformation where UserID='" & Me.txtUserID & "'"
rs.Open (strsql)
If rs.EOF Then
MsgBox "用户名不存在", vbCritical, "denglu"
Else
If rs.Fields("userpaddword").Value <> Me.txtuserpassword Then
MsgBox "mimacuo"
Else
MsgBox "success"
Unload Me
Form2.Show
End If
End If
cn.Close
Set cn = Nothing
Set rs = Nothing
ppp:
End Sub