Private Sub Command1_Click()
Dim conn As New ADODB.Connection, rs As New ADODB.Recordset
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=shop.mdb;Persist Security Info=False"
strSQL = "select * from 登陆 where name='" & Text1.Text & "'"
rs.Open strSQL, conn, 3, 3
If Text2.Text = rs.Fields("password") Then
Unload Me
Form2.Show
Else
MsgBox "用户名密码错误"
End If
rs.Close
conn.Close
End Sub
代码 看看是不是你需要的