I want to Access .mdb files and manipulate like insert / update using nodejs
Please suggest a library that would suite the need.
Thanks.
I want to Access .mdb files and manipulate like insert / update using nodejs
Please suggest a library that would suite the need.
Thanks.
Slightly different but node-adodb worked well for me for .accdb files:
https://www.npmjs.org/package/node-adodb
// Get the adodb module
var ADODB = require('node-adodb');
ADODB.debug = true;
// Connect to the MS Access DB
var connection = ADODB.open('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\dbs\\my-access-db.accdb;Persist Security Info=False;');
// Query the DB
connection
.query('SELECT * FROM [TestTable];')
.on('done', function (data){
console.log('Result:'.green.bold, data);
})
This article describes the process for connecting PHP to an Access .mdb database: http://www.sitepoint.com/using-an-access-database-with-php/
The process for Node.js is quite similar - it's just another ODBC data source.
You'll need a node ODBC package, such as:
https://github.com/wankdanker/node-odbc
https://github.com/markdirish/node-odbc/
Then you'll need to format your ODBC connection string. eg.
"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=MyDatabase; Uid=; Pwd=;"
"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="+path+"; Uid=; Pwd=;"
–
Ardithardme My suggestion is OWIN module which is currently developed as Edge.js by Mr Tomasz Janczuk.
Well i had this same issues too, the code below was able to fix mine
const path = require('path');
const ADODB = require('node-adodb');
const connectionString = path.resolve(__dirname, './test1.mdb');
const connection = ADODB.open(`Provider=Microsoft.Jet.OLEDB.4.0;Data Source=${connectionString};`);
connection.query("SELECT * FROM users").then((data) => {
console.log(data);
}).catch(err => {
console.error(JSON.stringify(err))
});
© 2022 - 2024 — McMap. All rights reserved.