Results 1 to 8 of 8

Thread: [RESOLVED] SQL Help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2010
    Posts
    71

    Resolved [RESOLVED] SQL Help

    Hello Guys, I am trying to change my software from using an access database to a ms sql server dbase. I have already installed. I used a module to handle connection to the database. and when i try run the vb app all am getting is this error

    [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    My connection string is as thus..

    conn.ConnectionString = "Provider = sqloledb;" & _
    "Data Source={DABUSHAR};" & _
    "Initial Catalog={sdp};" & _
    "User ID={Pertoh};" & _
    "Password={};"
    conn.Open

    Please Help

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: SQL Help

    Probably would have been better to post this in the Database portion of the forum. I'm not familiar with MySQL, but the use of those brackets sure doesn't look correct.
    Maybe spend some time in the forum's DB FAQ section
    Here's a list of MySQL connection statements

    Edited: Blew that one. Not sure where I got MySQL from... but here are sample connection strings for most databases
    Last edited by LaVolpe; Jan 2nd, 2011 at 08:24 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: SQL Help

    LaVolpe - not sure what mySQL has to do with anything, except maybe your eyes getting tired... but that's beside the point.

    Patoh - I'd say that your connection string is wrong. Specifically removing all the { and }

    -tg

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2010
    Posts
    71

    Re: SQL Help

    Ok!! Al try that techgnome..... I used different strings from that link LaVolpe...

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2010
    Posts
    71

    Re: SQL Help

    i tried this and am still getting an invalid string connection

    conn.ConnectionString = "Provider=SQLNCLI;Server=DABUSHAR;Database=sdp;Uid=Pertoh; Pwd=;"
    conn.Open

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Nov 2010
    Posts
    71

    Re: SQL Help

    I got it.. i used another connection string and it worked. I used:
    conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=sdp;Data Source=."

    Thanx Guyz

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] SQL Help

    Ah... ok, so your SQL Server is using Windows Authentication instead of SQL Authentication...that would do it then.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Nov 2010
    Posts
    71

    Re: [RESOLVED] SQL Help

    Yeah.. Switched sql server to windows authentication then used the string that supports win auth... iT works on all the programs

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