Results 1 to 3 of 3

Thread: Sql Login Form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    26

    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

  2. #2
    Member
    Join Date
    Oct 2007
    Posts
    35

    Re: Sql Login Form

    I am aslo looking for this, can somebody say this, for vb6?

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width