Problem
I need to access the data of an access database (*.mdb). The approach should be written in nodejs and be used by multiple users that should NOT be required to make any changes to the ODBC drivers list in Windows.
Approaches
I've found the node-odbc
. Looking at the documentation following snippet should work just fine:
const db = require('odbc');
const cn = `Provider=Microsoft.Jet.OLEDB.12.0;Data Source=C:\\Users\\some\\Dev\\db.mdb`;
db.connect(cn, (err, connection) => {
if (err) {
console.error(err);
}
console.log(connection);
});
Unfortunately is this the output I get:
[Error: [odbc] Error connecting to the database] {
odbcErrors: [
{
state: 'IM002',
code: 0,
message: '[Microsoft][ODBC Driver Manager] The DSN could not be found and' +
'there was no default driver specified'
}
]
}
null