Conn string - am I an idiot?

Results 1 to 3 of 3

Thread: Conn string - am I an idiot?

  1. #1
    Join Date
    Dec 1969

    Default Conn string - am I an idiot?

    Ok, something is wrong. I&#039;m getting an unable to open...error for the below<BR><BR>Set canvasDB = Server.CreateObject("ADODB.Connection")<BR>conn="D RIVER={Microsoft Access Driver (*.mdb)}; "<BR>strConn=conn & "DBQ=" & Server.MapPath("opsdb.mdb")<BR><BR>I just don&#039;t understand why it can&#039;t open the db.

  2. #2
    Join Date
    Dec 1969

    Default Yes

    Just kidding, thought you wanted us to answer. ; )<BR><BR>Seriously though, try the following :<BR><BR>Set canvasDB = Server.CreateObject("ADODB.Connection")<BR>canvasD B.ConnectionString = "provider=Microsoft.jet.oledb.4.0;Data Source="&server.mappath("opsdb.mdb")&";" <BR><BR>If it doesn&#039;t work check that you have the right filepath in server.mappath like:<BR><BR> server.mappath("/yourpath/opsdb.mdb")<BR><BR>good luck<BR>pete<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Why do you use...

    ...the .ConnectionString form??? I have never understood that.<BR><BR>After you do that, you *STILL* have to then call<BR> canvasDB.Open<BR><BR>whereas, if you simply do<BR> canvasDB.Open "provider= ...."<BR><BR>you do it in one fewer statements. What advantage is there in using ConnectionString??<BR><BR>

Posting Permissions

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