Private Sub Command1_Click()
Dim strpassword As String
If Combo1.Text = "" Or Text1.Text = "" Then '用户或密码不能为空
MsgBox "请选择用户名和输入密码!", 64, "警告"
Exit Sub
End If
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\桌面\练习\sp.mdb;Persist Security Info=False"
conn.Open
rs.Open "select yhm,mm from xt where yhm ='" & Combo1.Text & "' and mm ='" & Text1.Text & "' ", conn, adOpenKeyset, adLockBatchOptimistic
If Combo1.Text = rs.Fields(0).Value And Text1.Text = rs.Fields(1).Value Then
MDIForm1.Show
If Combo1.Text = "111" Then
MDIForm1.af.Visible = False
End If
MsgBox "登陆成功哦!", 64, "提示"
Else
MsgBox "登陆信息出错!", 64, "提示"
End If
MDIForm1.Show
Unload Me
End Sub
有知道的麻烦告诉下 谢.........
Dim strpassword As String
If Combo1.Text = "" Or Text1.Text = "" Then '用户或密码不能为空
MsgBox "请选择用户名和输入密码!", 64, "警告"
Exit Sub
End If
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\桌面\练习\sp.mdb;Persist Security Info=False"
conn.Open
rs.Open "select yhm,mm from xt where yhm ='" & Combo1.Text & "' and mm ='" & Text1.Text & "' ", conn, adOpenKeyset, adLockBatchOptimistic
If Combo1.Text = rs.Fields(0).Value And Text1.Text = rs.Fields(1).Value Then
MDIForm1.Show
If Combo1.Text = "111" Then
MDIForm1.af.Visible = False
End If
MsgBox "登陆成功哦!", 64, "提示"
Else
MsgBox "登陆信息出错!", 64, "提示"
End If
MDIForm1.Show
Unload Me
End Sub
有知道的麻烦告诉下 谢.........
