Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2006
    Posts
    82

    Unanswered: Connection in vb 6.0 app

    Ok first time poster here. I am very inexperienced with SQL and most all programs I am trying to use, lol. Taking on too much too soon I guess. Ok, I am having a problem in VB but I think it has to do something with a setting I have in SQL server. here it is. I am trying to make a connection to a databasae using this code in VB

    ConnectString = "Provider=MSDASQL.1;Password=password;Persist Security Info=True;User ID=sa;Data Source=mas500_app;Initial Catalog="

    It is giving me a data source not found and no default driver specified. I know for a fact that this is the correct name for the database. Another mock database i created works fine. So what could be the problem. Is there something in SQL Server that i need to tweak in order for VB to open this connection? Any help would be greatly appreciated and a round of beers would seem to be in order as well. thanks alot.

  2. #2
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by tibor

    ConnectString = "Provider=MSDASQL.1;Password=password;Persist Security Info=True;User ID=sa;Data Source=mas500_app;Initial Catalog="
    You haven't mentioned the Initial Catalog.OK first of all check these things.
    1.Make sure that User and password are correct.
    2.Check the server name.
    Try this one ...
    Provider=SQLOLEDB.1;Persist Security Info=true;User ID=sa;Password=password;Initial Catalog=Test
    I hope this will solve your problem.
    Joydeep

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    I am not 100% on this however I believe that MSDASQL.1 is now considered obsolete. I have certainly never used it. I have certainly seen things on the web re bugs and slow running using this provider. Have a look at http://www.connectionstrings.com/ and see if you can improve things.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hmm - not sure if this is the very same thing but:
    http://www.carlprothman.net/Default....rODBCDatabases
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    From Bill himself:
    http://msdn.microsoft.com/library/de...components.asp

    Also - you would be strongly advised not to use the SA account for connecting to your server. Use either windows authentification (MS recommeded) or create a new SQL Server Login with only the permissions required of the user.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Mar 2006
    Posts
    82
    Thanks alot for the help. Sad thing was, I had visited connectionstrings.com and even saved it to my favorites last night but failed to even give it a shot. It got me one stone closer to where I need to go. Now it's off to some VB forums to solve other issues. I am sure I will return for more simple stuff in the near future. Again, thanks.

    TIbor

Posting Permissions

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