This topic is locked

dbconnection questions

2/17/2010 11:54:55 PM
ASPRunnerPro General questions
R
Roland author

If someone has time, I am trying to understand the differences between these two connection strings: <%

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("db\database.mdb") & ";Jet OLEDB:Database Password="

%> and... <%

strConnection = "Driver={Microsoft Access Driver (.mdb, .accdb)};DBQ=" & Server.MapPath("db\database.mdb") & ";Uid=;Pwd="

%> . I can get my web page to work with the first connection string, but the second example always gives me an error. The build is done on machine running XP Pro SP3, the webpage is on Server 2003. Thank you in advance.

C
clig 2/18/2010



If someone has time, I am trying to understand the differences between these two connection strings: <%

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("db\database.mdb") & ";Jet OLEDB:Database Password="

%> and... <%

strConnection = "Driver={Microsoft Access Driver (.mdb, .accdb)};DBQ=" & Server.MapPath("db\database.mdb") & ";Uid=;Pwd="

%> . I can get my web page to work with the first connection string, but the second example always gives me an error. The build is done on machine running XP Pro SP3, the webpage is on Server 2003. Thank you in advance.


http://www.connectionstrings.com/access

Sergey Kornilov admin 2/18/2010

Both are valid connection strings. The second one requires specific ODBC driver to be installed which is not the case on some web servers.
If second connection string is not working for you you can use the first one. This change can be made in include/dbconnection.asp file.