1.1.3 • Published 5 years ago

database-js-adodb v1.1.3

Weekly downloads
13
License
MIT
Repository
github
Last release
5 years ago

database-js-adodb

Build Status

Database-js Wrapper for ADODB

About

Database-js-adodb is a wrapper around the node-adodb package by nuintun. It is intended to be used with the database-js package. However it can also be used in stand alone mode. The only reason to do that would be to use Promises.

Because it depends on node-adodb, database-js-adodb will only work on Windows, or more correctly on operating systems which can do ADO access from the Windows Script cscript.

Usage

Stand Alone

var adodb = require('database-js-adodb');

(async () => {
    let connection, rows;
    connection = mysql.open({
        Database: 'C:\\Users\\me\\Desktop\\access_db.mdb'
    });
    
    try {
        rows = await connection.query("SELECT * FROM tablea WHERE user_name = 'not_so_secret_user'");
        console.log(rows);
    } catch (error) {
        console.log(error);
    } finally {
        await connection.close();
    }
})();

With Database-js

var Database = require('database-js2');

(async () => {
    let connection, statement, rows;
    connection = new Database('database-js-adodb:///C:\\Users\\me\\Desktop\\access_db.mdb');
    
    try {
        statement = await connection.prepareStatement("SELECT * FROM tablea WHERE user_name = ?");
        rows = await statement.query('not_so_secret_user');
        console.log(rows);
    } catch (error) {
        console.log(error);
    } finally {
        await connection.close();
    }
})();

For Excel version 8

var Database = require('database-js2');

(async () => {
    let connection, statement, rows;
    connection = new Database('database-js-adodb:///C:\\Users\\me\\Desktop\\excel_file.xls?Extended Properties='Excel 8.0;HDR=Yes;IMEX=1';');
    
    try {
        statement = await connection.prepareStatement("SELECT * FROM [Sheet1$A1:C52] WHERE user_name = ?");
        rows = await statement.query('not_so_secret_user');
        console.log(rows);
    } catch (error) {
        console.log(error);
    } finally {
        await connection.close();
    }
})();
1.1.3

5 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.0

7 years ago