[求助]关于用户登陆的问题
各位请帮忙看看.为什么只能登陆一条记录啊 错误提示需要一个当前记录 "EOF 或BOF"中有一个是真
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student"
conn.Open
rs.ActiveConnection = conn
rs.Open "select * from 登录表 where user='" & txtuser.Text & "'and userpwd='" & txtpwd & "'", conn, 1, 3
If Trim(rs.Fields(0)) <> Trim(txtuser.Text) Then
MsgBox "用户名不存在"
try_time = try_time + 1
If try_time >= 3 Then
MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭"
End
Else
Exit Sub
End If
End If
If Trim(rs.Fields(1)) <> Trim(txtpwd.Text) Then
MsgBox "密码错误"
try_time = try_time + 1
If try_time >= 3 Then
MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭"
End
Else
Exit Sub
End If
End If