MS Access Connection Strings

There are two common connection string types that can be used to connect to an MS Access database.

One of them:

Driver={Microsoft Access Driver (*.mdb)};DBQ=Database.mdb


The other one:

PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=Database.mdb


Normally I haven't had a problem using both of these, but I experience the first one to be better. When running UPDATE queries against the second one (PROVIDER) I got the error code -2147217900 with the message "Syntax error in UPDATE statement. Microsoft JET Database Engine." when there were NO syntax errors what-so-ever. I even tried the query directly in MS Access with success. All permissions were OK as well and easy to handle.

Once I swapped to the "Driver" connection string, it worked perfectly.

I find this information very useful, especially since there are no indicative or direct logics behind this issue.

Written by: Dag Jonny Nedrelid
©2007-2012 http://thronic.com


Feel free to leave a comment.
Name:
URL:
0