Results 1 to 2 of 2

Thread: Verify username and password with mysql + vb

  1. #1
    Join Date
    Apr 2003
    Posts
    5

    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

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    '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
  •