DSN less connection error

Results 1 to 2 of 2

Thread: DSN less connection error

  1. #1
    Tony H Guest

    Default DSN less connection error

    I have always used system dsn&#039s for connectivity, but I decided to try a dsn-less for some reason and here is the error I am getting:<BR><BR>DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= C:Inetpubwwwrootfpdblvcp.mdb <BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] &#039(unknown)&#039 is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides<BR><BR>Here is the code behind it:<BR><BR>Set connection = Server.CreateObject("ADODB.Connection")<BR>strDB = server.mappath("/fpdb/lvcp.mdb")<BR>strConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; " <BR>strConnection = strConnection & "DBQ= "&strDB&" " <BR>response.write strConnection &#039 debug purposes<BR>connection.open strConnection<BR><BR>As you can see from the first line of the error, where the response.write wrote out the strConnection, that is the exact path to my database, but it&#039s telling me it&#039s not a valid path. Why? If I explicity type in the path, it works. Is it something with the server.mappath function? Let&#039s say I want to use the mappath method with our ISP, because I don&#039t know the exact path to my database, how would I use the mappath method?<BR>Thanks for any advise,<BR><BR>Tony<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: DSN less connection error

    The problem may simply be the extra space you put in<BR>there after "DBQ=" and the file name.<BR><BR>The code that works for me:<BR><BR>Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);" _<BR> & "DBQ=" & Server.MapPath("BulletinBoard.mdb")<BR><BR>Notice no space after the ; and before the DBQ and no space after the = and before the name and no space on the end.<BR><BR>Also no {...} braces, but I don&#039t think that is relevant.<BR><BR>My bet would be the space after the =, since mayhap the connection interpreter sees the space as the *end* of the DBQ name, you get a null name, and of course that is "unknown".<BR><BR>No guarantees, but those are the only differences between your stuff and mine, and mine works.<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