新手求组~一直提示recordset 对象关闭时不允许操作
我想做个登陆界面,是这样写的Private Sub Command1_Click()
Dim cnn As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim cmd As New
cnn.ConnectionString = ("provider=SQLOLEDB.1;Persist Security Info=False;Integrated Security=SSPI;CATALOG=车辆管理正式版;")
cnn.Open
Set rs1.ActiveConnection = cnn
rs1.Open ("use 车辆管理正式版 select * from zhanghu where 用户名='" & Text1.Text & "' and 密码='" & Text2.Text & "'")
If rs1.EOF = True Then
MsgBox "用户名或密码错误!", vbInformation, "警告"
Text1.Text = ""
Text2.Text = ""
Else
Unload Me
MsgBox "登录成功"
Form2.Show
End If
rs1.Close
End Sub
每次到If rs1.EOF = True Then
那里就会出错。。。到底是怎么回事,请大家帮我看下,谢谢了