Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing .mdb files through nodejs

I want to Access .mdb files and manipulate like insert / update using nodejs

Please suggest a library that would suite the need.

Thanks.

like image 628
Beast Avatar asked Jan 29 '14 09:01

Beast


People also ask

How do I view a .MDB file?

Step 1: Launch MDB Viewer Software and click on the Open icon and select the MDB and click on OK. Step 2: Wait for the scanning process to get complete. Step 3: Choose the desired folder to preview the data. Step 4: For saving the whole data of MDB File click on the Upgrade button.

CAN node js Access database?

Node. js supports all kinds of databases no matter if it is a relational database or NoSQL database. However, NoSQL databases like MongoDb are the best fit with Node. js.


2 Answers

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);     }) 
like image 122
Rob Campion Avatar answered Oct 09 '22 02:10

Rob Campion


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=;" 
like image 45
Mike Causer Avatar answered Oct 09 '22 02:10

Mike Causer