Results 1 to 5 of 5

Thread: SQL Server User Logins from VB6...

  1. #1

    Thread Starter
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Question SQL Server User Logins from VB6...

    Hi...

    I always make user logins and passwords in 1 table. I make a table to store my user ID and passwords. When my app runs, it will check the user ID and passwords in that table.

    Now, I'm asked to check the User ID and password to SQL Server Logins ID.
    Do you know how to check the User ID and password to SQL Server Login ID from VB6 ???


    Regards,
    Wille
    Attached Images Attached Images  

  2. #2
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    I maybe missing something but doesnt your connection string do that???

    cn.Open "Provider=sqloledb;" & _
    "Data Source=myServerName;" & _
    "Initial Catalog=DbName;" & _
    "User Id=Username;" & _
    "Password=Password"

  3. #3
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    I agree w/ Beacon on this. Try to make a connection to the server using the users login. Be sure to trap any errors. You can then check any error messages that are returned to see if the user has access to the server or not. That's how I handle it anyway.

    Or...

    If you're familiar with how SQL encrypts passwords in the syslogins table, you could check the userid and password against that table.
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  4. #4

    Thread Starter
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524
    one thing for sure is....
    I don't know how to get the user.
    Suppose like this :

    In Database "FtyDB", I have user list in user tab ==> mydomain\Wen_Lie, with wl as the password.

    Can I just use what beacon said ???

    __________________
    Wille

  5. #5
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    yup

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