This topic is locked

dbconnection ERROR

12/29/2003 10:03:36 AM
ASPRunnerPro General questions
swat author

hi admin-
I am getting this error every time I use asprunner 2.4 :

Error number -2147467259

[Microsoft][ODBC Microsoft Access Driver] '(unknown)' 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.


Here is the my two different dbconnections , first one developed by asprunner 2.4 and does not connect to the DB.

<%

strConnection = "Provider=MSDataShape;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=U:/asp/db/db4.mdb;UID=;PWD="

%>


This is my second dbconnection , which is developed by asprunner 2.3 and it works just fine.... (even with asprunner 2.4 pages just need to replace this connection code on file)

<%

strConnection = "Provider=MSDataShape;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("db\db4.mdb") & ";UID=;PWD="

%>


Any one having this problem or it is just me??? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=278&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' />
Thanks all

Sergey Kornilov admin 12/29/2003

Swat,
you always have to use Server.MapPath option. This option generates correct path to database file.
This connection string is incorrect because it uses absolute path instead of relative:

<%

strConnection = "Provider=MSDataShape;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=U:/asp/db/db4.mdb;UID=;PWD="

%>


Best regards,

Sergey Kornilov