VB+ACCESS 做的登入器怎么老出错~请大神帮帮忙~!!
Private Sub Command1_Click()Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Dim connstr As String
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\db1.mdb;Persist Security Info=False"
ql = "select * from table where uesrname='" & Text1.Text & "'"
conn.CursorLocation = adUseClient
conn.connectionstring = connstr
conn.Open
rs.Open sql, conn, adOpenStatic, adLockOptimistic, 1
'Set rs = conn.Execute(sql)
'rs.Open sql, conn, adOpenStatic, adLockOptimistic
If rs.RecordCount = 0 Then
MsgBox "用户不存在"
rs.Close
conn.Close
Exit Sub
End If
If Text2.Text <> rs("password") Then
MsgBox "密码错误"
rs.Close
conn.Close
Else
rs.Close
conn.Close
from2.Show
Unload Me
End If
End Sub
Private Sub Form_Load()
Dim conn As New ADODB.Connection
Dim connectionstring As String
connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:\glxt.mdb;Persist Security Info=False"
End Sub