Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21842

item could not be found in the collection corresponding to the requested name or ordi

$
0
0
why do i get this error if my fields are correct?
Code:

Dim EmpNo As String
Dim stat As String
Sub Verify_Account()
stat = 0
strSQL = "SELECT * FROM Users"
 
With rs
    .MoveFirst
    While Not .EOF
        If Txt(0).text = .Fields!UserName And Txt(1).text = .Fields!UserPass Then
            EmpNo = .Fields!UserID
            CN.Close
            stat = 1
            Exit Sub
        Else
            .MoveNext
        End If
    Wend
    MsgBox "user name or password wrong"
End With
CN.Close
End Sub

DB table Users
UserID, UserNme ,UserPass

Viewing all articles
Browse latest Browse all 21842

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>