bu supplemental essay:ADO问题呀呀

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/27 13:21:09
以下代码他说BOF或EOF中有一个是"真",或者当削的记录已被删除,所需的操作要求一个当前的记录
问题在哪里呀???,请高出来指点一下呀
Dim szg As ADODB.Connection
Dim seti As String
Dim strzh, strmm As String
Dim j, m As Variant
Dim sr As Recordset

Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
If txtname.Text <> "" And txtpass.Text <> "" Then

Set sr = szg.Execute("select * from zl where zh='" & txtname & "'")
a = sr("mm")

If Not sr.EOF And a = txtpass Then
Me.Hide
Load Form1
Form1.Show
Else
MsgBox "没有此用用户,或密码不正确请重新输入", vbCritical, "非法操作"

End If
Else
If txtname.Text = "" Then

MsgBox "请输入帐号", vbCritical, "输入帐号"
txtname.SetFocus
ElseIf txtpass.Text = "" Then
MsgBox "请输入密码", vbCritical, "请输入密码"
txtpass.SetFocus
End If
End If
End If
If Index = 1 Then
End
End If
If Index = 2 Then
Me.WindowState = vbMinimized: f1.Show 1
End If
End Sub