Menu

Tree [6f8de8] master /
 History

HTTPS access


File Date Author Commit
 html 2019-09-27 Patrick Ingle Patrick Ingle [6f8de8] Move API list to new route, fixed POST requests...
 node_modules 2019-09-27 Patrick Ingle Patrick Ingle [6f8de8] Move API list to new route, fixed POST requests...
 resources 2019-09-09 Patrick Ingle Patrick Ingle [a9d68d] fixed the uncaught exception thrown in node-ado...
 README.md 2019-09-19 Patrick Ingle Patrick Ingle [2ea52c] Added route listing to base|root route of http:...
 app.js 2019-09-27 Patrick Ingle Patrick Ingle [6f8de8] Move API list to new route, fixed POST requests...
 build.cmd 2019-09-27 Patrick Ingle Patrick Ingle [6f8de8] Move API list to new route, fixed POST requests...
 package-lock.json 2019-09-27 Patrick Ingle Patrick Ingle [6f8de8] Move API list to new route, fixed POST requests...
 package.json 2019-09-27 Patrick Ingle Patrick Ingle [6f8de8] Move API list to new route, fixed POST requests...
 settings.json 2019-09-07 Patrick Ingle Patrick Ingle [7afb41] Initial Commit
 test.accdb 2019-09-07 Patrick Ingle Patrick Ingle [7afb41] Initial Commit

Read Me

Access Database as a Server

The following code will turn any accdb (Access Database) into a Database invocable via a REST API

Dependencies

  1. Requires Microsoft Access Database Engine 2016 Redistributable (install 32 bit version, even though you have x64 system) at https://www.microsoft.com/en-US/download/details.aspx?id=13255
  2. Requies NPM and Node, if not using the standalone executable?

Starting the Database

Settings.JSON

Edit the settingsjson to specify the accdb database file

{
    "domain": "localhost",
    "host": "localhost",
    "port": 5151,
    "database": "test.accdb",
    "password": "5f4dcc3b5aa765d61d8327deb882cf99"
}

Launching server

From the Windows command line, requires Node/NPM to be installed (https://nodejs.org/en/download/)

> node app.js

or download the files accdb-server.exe, settings.json, and test.accdb.

Then start the standalone executable,

> accdb-server

Testing Server

From your web browser, open http://localhost:5151/sql?sql=select%20*%20from%20table1

the results will show in a JSON array.

List all routes

To list all routes available, use

http://localhost:5151/

API Routes

  • query = used for SELECT queries
  • execute = used for INSERT, UPDATE, DELETE queries
  • sql = used for INSERT, UPDATE, DELETE queries (kept for backwards compatibility)
  • about = information (if npm is installed, will show npm module hierarchy)

Build a standalone Win64 executable

Install the pkg module,

> npm install -g pkg

Create the standalone executable,

> pkg -t node10-win app.js 
> move app.exe accdb-server.exe
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.