Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2005
    Location
    Orange, California, USA
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    connection string to sql db (VB6/SQL Server)

    I am trying to create a connection string in VB6 to a database I just created on our SQL server. I created the UDL file, thinking that there might be a way to extract the textual part of the connection string that I could use in code, but it didn't work as I expected. If someone could tell me the shortcut I'm trying to remember I would appreciate it. Otherwise, can anyone answer what I use for user and password in the connection string when using Windows NT integrated security?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: connection string to sql db (VB6/SQL Server)

    I've never used Windows security on the SQL database itself. I just assumed the VB app would pass those credentials to the server upon request, so the connection string would only include any password set in the database itself.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: connection string to sql db (VB6/SQL Server)

    Pardon me if I've misunderstood, but I've never used a username and password for Integrated Security. Your Windows login credentials should take care of your permissions. With very minor variations I use the following:

    oConn.Open "Provider=sqloledb;Data Source=servername;Initial Catalog=dbname;Integrated Security=SSPI;"

    Also you may want to check out this article
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

Posting Permissions

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