-
Verify username and password with mysql + vb
Hi,
I am building a VB application which is connected to a mysql database. I have a login form and have no clue how to search through the users table to check that their username exists and if it does that it matches the password for that record. The connection is by myodbc and using ado.
Any suggestions?
Thanks
-
'if you adodb connection is rs
'if your login table in mysql is usertable
rs.RecordSource = "Select count(*) as COUNT1 from usertable bin where loginid ='" & loginname.Text & " ' and password ='" & passwordtxt.text &"'"
rs.Refresh
If rs.Recordset("COUNT1") > 0 Then
msgbox "Login correct"
Else
msgbox "Login incorrect. Try again"
loginname.setfocus
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|