Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007

    Unanswered: ASP SQL Connection String Problem

    Hi, posted this in the wrong place I think earlier, I hope this is more suitable...



    I have some ASP code that connects to an Access database. I am now trying change this code so it connects to my new SQL server database.

    Can someone suggest what I am doing wrong as I get an error:

    Microsoft OLE DB Provider for SQL Server (0x80004005)
    [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    Original connection string is:

    Set DBConn=Server.CreateObject("ADODB.Connection")
    DBConn.Open Server.MapPath("../db/databasename.mdb")

    New string (not working) is:

    set DBConn = Server.CreateObject("ADODB.Connection")
    sConn = "Provider=SQLOLEDB.1;User ID=USERID;password=PASSWORD;Initial Catalog=DATABASENAME;Data Source = SQLSERVERNAME;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096"
    DBConn.Open sConn

    Many thanks.

  2. #2
    Join Date
    Nov 2004
    Provided Answers: 1
    Try the following code, pretty much the same:

    set DBCon = CreateObject("Adodb.Connection")
    DBCon.ConnectionString = "driver={SQL Server};SERVER=SERVER;uid=USERNAME;pwd=PASSWORD;da tabase=DATABASE"


    Like I said pretty much the same as what you have, just don't need all the other parameters.

Posting Permissions

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