{"id":17750569,"url":"https://github.com/nuintun/node-adodb","last_synced_at":"2025-04-05T04:12:10.163Z","repository":{"id":15627830,"uuid":"18364623","full_name":"nuintun/node-adodb","owner":"nuintun","description":"A node.js javascript client implementing the ADODB protocol on windows.","archived":false,"fork":false,"pushed_at":"2023-12-06T14:22:28.000Z","size":3228,"stargazers_count":185,"open_issues_count":36,"forks_count":51,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-09-19T12:47:56.787Z","etag":null,"topics":["access","adodb","adodb-library","javascript","node","node-adodb","node-module","sql","windows"],"latest_commit_sha":null,"homepage":"https://nuintun.github.io/node-adodb","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuintun.png","metadata":{"files":{"readme":"README-EN.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://paypal.me/nuintun"}},"created_at":"2014-04-02T11:49:39.000Z","updated_at":"2024-09-11T16:43:26.000Z","dependencies_parsed_at":"2024-06-18T15:13:24.730Z","dependency_job_id":null,"html_url":"https://github.com/nuintun/node-adodb","commit_stats":{"total_commits":447,"total_committers":13,"mean_commits":34.38461538461539,"dds":0.3064876957494407,"last_synced_commit":"1089dae636e23ba6ca61c027b75543d095871373"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fnode-adodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fnode-adodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fnode-adodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fnode-adodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuintun","download_url":"https://codeload.github.com/nuintun/node-adodb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284951,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["access","adodb","adodb-library","javascript","node","node-adodb","node-module","sql","windows"],"created_at":"2024-10-26T12:22:40.196Z","updated_at":"2025-04-05T04:12:10.121Z","avatar_url":"https://github.com/nuintun.png","language":"JavaScript","funding_links":["https://paypal.me/nuintun"],"categories":[],"sub_categories":[],"readme":"# node-adodb\n\n\u003e A node.js javascript client implementing the ADODB protocol on windows.\n\u003e\n\u003e [![NPM Version][npm-image]][npm-url]\n\u003e [![Download Status][download-image]][npm-url]\n\u003e [![Windows Status][appveyor-image]][appveyor-url]\n\u003e [![Test Coverage][coveralls-image]][coveralls-url]\n\u003e ![Node Version][node-image]\n\u003e [![Dependencies][david-image]][david-url]\n\n### Install\n\n[![NPM](https://nodei.co/npm/node-adodb.png)](https://nodei.co/npm/node-adodb/)\n\n### Introduction:\n\n##### ES6\n\n```js\n'use strict';\n\nconst ADODB = require('node-adodb');\nconst connection = ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=node-adodb.mdb;');\n\n// Transaction\nconnection\n  .transaction([`INSERT INTO Users(UserId, UserName, UserSex, UserBirthday, UserMarried) VALUES (10, \"Tom\", \"Male\", \"1981/5/10\", 0);`,\n          `INSERT INTO Users(UserId, UserName, UserSex, UserBirthday, UserMarried) VALUES (11, \"Brenda\", \"Female\", \"2001/1/11\", 0);`,\n          `INSERT INTO Users(UserId, UserName, UserSex, UserBirthday, UserMarried) VALUES (10, \"Bill\", \"Male\", \"1991/3/9\", 0);`])\n  .then(data =\u003e {\n    console.log(\"We will not arrive because a duplicate id is generated. When encountering an error do not insert any record.\");\n  })\n  .catch(error =\u003e {\n    console.error(error);\n  });\n\n// Execute\nconnection\n  .execute('INSERT INTO Users(UserName, UserSex, UserAge) VALUES (\"Newton\", \"Male\", 25)')\n  .then(data =\u003e {\n    console.log(JSON.stringify(data, null, 2));\n  })\n  .catch(error =\u003e {\n    console.error(error);\n  });\n\n// Execute with scalar\nconnection\n  .execute('INSERT INTO Users(UserName, UserSex, UserAge) VALUES (\"Newton\", \"Male\", 25)', 'SELECT @@Identity AS id')\n  .then(data =\u003e {\n    console.log(JSON.stringify(data, null, 2));\n  })\n  .catch(error =\u003e {\n    console.error(error);\n  });\n\n// Query\nconnection\n  .query('SELECT * FROM Users')\n  .then(data =\u003e {\n    console.log(JSON.stringify(data, null, 2));\n  })\n  .catch(error =\u003e {\n    console.error(error);\n  });\n\n// Schema\nconnection\n  .schema(20)\n  .then(schema =\u003e {\n    console.log(JSON.stringify(schema, null, 2));\n  })\n  .catch(error =\u003e {\n    console.error(error);\n  });\n```\n\n##### ES7 async/await\n\n```js\n'use strict';\n\nconst ADODB = require('node-adodb');\nconst connection = ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=node-adodb.mdb;');\n\nasync function query() {\n  try {\n    const users = await connection.query('SELECT * FROM Users');\n\n    console.log(JSON.stringify(users, null, 2));\n  } catch (error) {\n    console.error(error);\n  }\n}\n\nquery();\n```\n\n### API:\n\n`ADODB.open(connection[, x64]): ADODB`\n\n\u003e Initialization database link parameters.\n\n`ADODB.query(sql): Promise`\n\n\u003e Execute a SQL statement that returns a value.\n\n`ADODB.execute(sql[, scalar]): Promise`\n\n\u003e Execute a SQL statement with no return value or with updated statistics.\n\n`ADODB.transaction(sql[]): Promise`\n\n\u003e Execute multiple SQL statement as a transaction.\n\n`ADODB.schema(type[, criteria][, id]): Promise`\n\n\u003e Query database schema information. see: [OpenSchema](https://docs.microsoft.com/en-us/sql/ado/reference/ado-api/openschema-method)\n\n### Debug:\n\n\u003e Set env `DEBUG=ADODB`, see: [debug](https://github.com/visionmedia/debug)\n\n### Extension:\n\n\u003e This library theory supports all databases on the Windows platform that support ADODB connections, and only need to change the database connection string to achieve the operation!\n\n\u003e Common access connection strings:\n\u003e\n\u003e - Access 2000-2003 (\\*.mdb): `Provider=Microsoft.Jet.OLEDB.4.0;Data Source=node-adodb.mdb;`\n\u003e - Access \u003e 2007 (\\*.accdb): `Provider=Microsoft.ACE.OLEDB.12.0;Data Source=adodb.accdb;Persist Security Info=False;` or `Provider=Microsoft.ACE.OLEDB.15.0;Data Source=adodb.accdb;Persist Security Info=False;`\n\n### Notes:\n\n\u003e The library need system support `Microsoft.Jet.OLEDB.4.0` or `Microsoft.ACE.OLEDB.12.0`, `Windows XP SP2` above support `Microsoft.Jet.OLEDB.4.0` by default, Others need to install support!\n\u003e\n\u003e Recommended use `Microsoft.ACE.OLEDB.12.0`, download: [Microsoft.ACE.OLEDB.12.0](https://www.microsoft.com/en-us/download/details.aspx?id=13255)\n\n### Electron\n\n\u003e If you want to use this module in an electron app running from an asar package you'll need to make some changes.\n\n\u003e 1. Move `adodb.js` outside the asar package (in this example I use electron-builder, the `extraResources` option can move the file outside the asar package)\n\n```json\n\"extraResources\": [\n  {\n    \"from\": \"./node_modules/node-adodb/lib/adodb.js\",\n    \"to\": \"adodb.js\"\n  }\n]\n```\n\n\u003e 2. Tell the module where to find `adodb.js` while running from an asar package (I added this in electron's `main.js` file)\n\n```javascript\n// Are we running from inside an asar package ?\nif (process.mainModule.filename.indexOf('app.asar') !== -1) {\n  // In that case we need to set the correct path to adodb.js\n  ADODB.PATH = './resources/adodb.js';\n}\n```\n\n[npm-image]: https://img.shields.io/npm/v/node-adodb.svg?style=flat-square\n[npm-url]: https://www.npmjs.org/package/node-adodb\n[download-image]: https://img.shields.io/npm/dm/node-adodb.svg?style=flat-square\n[appveyor-image]: https://img.shields.io/appveyor/ci/nuintun/node-adodb/master.svg?style=flat-square\u0026label=windows\n[appveyor-url]: https://ci.appveyor.com/project/nuintun/node-adodb\n[coveralls-image]: http://img.shields.io/coveralls/nuintun/node-adodb/master.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/nuintun/node-adodb?branch=master\n[david-image]: https://img.shields.io/david/nuintun/node-adodb.svg?style=flat-square\n[david-url]: https://david-dm.org/nuintun/node-adodb\n[node-image]: https://img.shields.io/node/v/node-adodb.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuintun%2Fnode-adodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuintun%2Fnode-adodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuintun%2Fnode-adodb/lists"}