VB6 Sqlserver connection issue-VBForums
Results 1 to 5 of 5

Thread: VB6 Sqlserver connection issue

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    3

    VB6 Sqlserver connection issue

    i have been banging my head against this on and off for days. Time for help from people who know what they are doing!

    i have a default installation of SQL Server Express 2008 running with VB6 Pro installed. I am running Windows XP.

    I have managed to create 2 tables(Psswrd and GameTable) and can see these through the SQL server management studio.

    So far so good!

    however, when i run the code i am getting an "Invalid connection string attribute"! through the conConnection.open command.

    Here is my connection string.

    conConnection.ConnectionString = "Provider=SQLNCLI10;Data Source=CHAD-H8H5UNYBQS\SQLEXPRESS;Initial Catalog=Psswrd;UserId=CHAD-H8H5UNYBQS\Chad;Password="

    I am using Windows Authentication to log into the db for the SQL management studio. Do i need a password setup? If so, where do I go for this?

    I suspect my issues are legion, but are fairly simple to solve. I am just having issues finding information so I came here to ask!!

    I have a feeling the answer is pretty obvious and I am the numbskull!

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    37,116

    Re: VB6 Sqlserver connection issue

    Welcome to VBForums

    Thread moved to the 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)


    With Windows authentication you do not put any login details into the connection string, that part will be dealt with automatically. For examples of how it should be, see the connection strings link in my signature.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    3

    Re: VB6 Sqlserver connection issue

    is this the string you were refering too?


    Trusted Connection
    Driver={SQL Server Native Client 10.0};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;

    Equivalent key-value pair: "Integrated Security=SSPI" equals "Trusted_Connection=yes"

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    3

    Re: VB6 Sqlserver connection issue

    okay, part of the issue was that the default db name is "master" and i was using a table name instead! how frustrating!

    ty!

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    37,116

    Re: VB6 Sqlserver connection issue

    is this the string you were refering too?
    That looks better.
    okay, part of the issue was that the default db name is "master" and i was using a table name instead! how frustrating!
    That would be a problem!

    Note that you generally shouldn't use the Master database, instead you should create new database(s) as apt (as a vague guide, one for each application).

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.