-
Sql Login Form
I'm looking for someone who can create, or show me how to create a form that connects to a remote SQL and gathers:
User ID
User Name
Password
Authority
And only goes to the 2nd form if the UserName and Password are correct.
Is there a tutorial for this? I couldn't find one. Thank to anyone who can help.
Ps. I'm using Vb 2008 express but I also have access to Vb6
-
Re: Sql Login Form
I am aslo looking for this, can somebody say this, for vb6?
-
Re: Sql Login Form
Assuming that you are getting the username/password from the user, you simply need a query based on those values, eg:
Code:
strSQL = "SELECT UserName FROM usertable WHERE UserName = '" & txtUserName.Text & "' AND password = '" & txtPassword.Text & "'"
You then run this against your database (if you don't know how, see our Database Development FAQs/Tutorials, at the top of the Database Development forum), and see if any rows were returned - if there are any, the username/password combination is correct.
On a separate note, you should change your field names, as they will probably all cause you errors (spaces are nasty, and things like Password are reserved words). For more info on that, see the "what names should I NOT use ..." article in the Design section our Database FAQs.