在登录界面中,如何与数据库access连接?????
Private Sub Command1_Click()
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
If Text1.Text = "" Then
MsgBox "请输入用户名", 48
Text1.SetFocus
End If
If Text2.Text = "" Then
MsgBox "请输入密码", 48
End If
rst.CursorLocation = adUseClient
rst.Open "select * from user where user = '" & Trim(Text1.Text) & "' and password='" & Trim(Text2.Text) & "' ", cnn, adOpenDynamic, adLockOptimistic, adCmdText
If rst.RecordCount > 0 Then
Load Form1
Form1.Show
请问怎么修改哦??
End If
End Sub