Results 1 to 12 of 12

Thread: [RESOLVED] Invalid Connection String Attribute

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    102

    Resolved [RESOLVED] Invalid Connection String Attribute

    Hello,

    Following is the connection string that i am using on my server machine, which works well on the same machine for running the app

    Code:
    ConData.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist " & _
                     "Security Info=true;Initial Catalog=master;Data Source=192.168.1.109,49158;username=username;password=passowrd"
    But When i run the same program in another machine i get the error "Invalid connection String Attribute".

    Could someone help me on what the problem might be here?

    Thanks.

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: Invalid Connection String Attribute

    Check here: Connection Strings on section Microsoft OLE DB Provider for SQL Server.
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    102

    Re: Invalid Connection String Attribute

    Thx fro the reply KGComputers, but i dont think if i have done anything that is not already in that site. According to me i have done the same thing.

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

    Re: Invalid Connection String Attribute

    You need to check a bit more carefully... if your string isn't exactly the same as one of theirs (apart from the values, such as the IP address), then you have probably got it wrong.

    At a glance, there are two obvious major differences:
    • you have "username=", and that doesn't appear anywhere on their page.
    • you have specified two different types of login: a username/password (for a SQL Server login), AND specified to not use that (use a Windows login). You should only have one listed.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    102

    Re: Invalid Connection String Attribute

    ok guys, now im using the follwoing sql connection string but now i am receiving another error.

    ConData.Open "Driver={SQL Server Native Client 10.0};Server=my-pc\sqlexpress;" & _
    "Database=master;Uid=muzamilsajid;Pwd=mypass;"

    this is working well on the server machine where sqlserver 2008 is installed but i dont get it as to why its not working on other machines. I get the following error.

    [Microsoft][Sql Server native Client 10.0]Sql server network interface error Locating Server/instance specified [xFFFFFFFF]

    Any help will be appreciated please guys, im stuck on this for almost 2 weeks now...i was trying it on my own with different connection strings before comming back to you guys. But it seems like i have reached a dead end were my head is like coming off now.....

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    102

    Re: Invalid Connection String Attribute

    Thank you for taking out some of your time for this guys but finally i got it solved.

    I just had to start the SQL Browser Service on my server machine and now all the connection strings are working without any issues.

    Thank you very much..

    I am sure ill soon come with another problem on hand.

    Thanks..

  7. #7
    New Member
    Join Date
    Mar 2019
    Posts
    7

    Re: Invalid Connection String Attribute

    What is the SQL browser service? even i am also getting "Invalid connection String Attribute" error

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

    Re: [RESOLVED] Invalid Connection String Attribute

    Welcome to VBForums

    The SQL Browser service probably isn't relevant to you, because that was in relation to a different error (see post 5), and is specific to SQL Server. If you need to solve that error, you can find Services in Control Panel - Admin Tools.


    In terms of the error "Invalid connection String Attribute", the issue is almost certainly that you have a mistake in your connection string.

    Use the site that was linked in post #2 to find a valid example connection string for the database system you are using and your situation, and make sure that yours is the same (except for things like the database name, etc).

    If you can't fix it with that, create a new thread here: http://www.vbforums.com/forumdisplay...se-Development ...and show us the section of code containing your connection string.

  9. #9
    New Member
    Join Date
    Mar 2019
    Posts
    7

    Re: [RESOLVED] Invalid Connection String Attribute

    Provider=sqloledb;Trusted_Connection=Yes;Data Source=Server name;Initial Catalogue=Name of the Database;username=username;password=password

    This is the piece of code i have used.
    I am using Microsoft SQL Server 2014
    Last edited by Abhi1987; Mar 14th, 2019 at 10:56 AM.

  10. #10
    New Member
    Join Date
    Mar 2019
    Posts
    7

    Re: [RESOLVED] Invalid Connection String Attribute

    please correct if anything is incorrect or i am missing.
    Last edited by Abhi1987; Mar 14th, 2019 at 10:56 AM.

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

    Re: [RESOLVED] Invalid Connection String Attribute

    I'm afraid that is incorrect in a variety of ways, and the way to solve it is to follow the advice I gave before:
    Quote Originally Posted by si_the_geek View Post
    Use the site that was linked in post #2 to find a valid example connection string for the database system you are using and your situation, and make sure that yours is the same (except for things like the database name, etc).

    If you can't fix it with that, create a new thread here: http://www.vbforums.com/forumdisplay...se-Development ...and show us the section of code containing your connection string.
    Note that if you do need help, creating a new thread is important (most people wont even look at your posts here), and posting just the connection string is not enough - the code around it is important too.

  12. #12
    New Member
    Join Date
    Mar 2019
    Posts
    7

    Re: [RESOLVED] Invalid Connection String Attribute

    I have created a new thread .. m not able to figure out the solution in post 2 .. please help me find the solution in my new thread .

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