我的代码片段,执行查询 后结果正确输出
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields("Name") = Trim(Text1.Text) Then
FindUser = True
If Adodc1.Recordset.Fields("Npassword") = Trim(Text2.Text) Then
Me.Hide
frmMain.Show
strUser = Trim(Text1.Text)
Unload Me
Exit Sub
Else
MsgBox "请重新输入用户密码!", vbOKOnly + vbExclamation, "警告"
Text2.Text = ""
Text2.SetFocus
Exit Sub
End If
End If
Adodc1.Recordset.MoveNext
Loop
If FindUser = False Then
MsgBox "没有这个用户,请重新输入!", vbOKOnly + vbExclamation, "警告"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Exit Sub
Data1.Recordset.FindFirst (findstu_id)
改成
Data1.Recordset.Find(findstu_id)
试试看!~