I’m doing a training tomorrow for which I needed to use a demo Microsoft Access database.
However, my laptop does not have ColdFusionMX 7 ODBC Server and ODBC Agent installed as Windows services. So, each time I try to setup a Microsoft Access datasource, I get a message:
The ColdFusion MX 7 ODBC Server service is not running or has not been installed.
You may also use the “MS Access with Unicode” driver to connect to MS Access datasources.
As I didn’t feel like manually installing the ODBC agent and server, I wondered if there was a way to simply use JDBC to connect directly to the Access database.
And there is.In ColdFusion Administrator, create a datasource of the type “other”. And use the following settings subsequently:
JDBC URL:
jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=[Full path to your database file];DriverID22;
Driver Class:
sun.jdbc.odbc.JdbcOdbcDriver
I prefer to always specify the Driver Name. It helps later to identify the database type from the datasource listing page. You can skip this if you don’t give a toss.
Drive Name:
MS Access via JDBC
Username, Password:
If the database requires any username, password, specify those.
Submit and and that’s it.