Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

476
Vistas
ms access db connection in node.js

I am trying to connect to an Access database with nuintun's node-adodb package. I have successfully connected to it in my laptop @ home and created a dist. package to install it to my computer @ office. However after installing it to my office laptop, I am getting below error message during connection to access database.

connection string: "Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=C:\\Temp\\Mdb.mdb;Persist Security Info=False;"

error message: Error: Spawn C:\WINDOWS\SysWOW64\cscript.exe error

I tried several connection configs to solve this but cannot get it done.

With this method (connection = ADODB.open(dbConn);) I am getting above error message.

With this connection = ADODB.open(dbConn, true) or this connection=ADODB.open(process.arch.includes('64') or this connection = ADODB.open(connection, 'x64') I am getting below error message:

Error: Spawn C:\WINDOWS\System32\cscript.exe error

Any help appreciated.

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

You can try installing MS Access Database Engine and then call it from your code via

Provider=Microsoft.ACE.OLEDB.16.0 (.....)

https://www.microsoft.com/en-us/download/details.aspx?id=54920. It helped me with the same issue you are facing now.

@Ozgun Senyuva, one more thing... because after packaging I spotted one more issue that was solved as per https://github.com/nuintun/node-adodb/blob/master/README-EN.md

Electron
If you want to use this module in an electron app running from an asar package you'll need to make some changes.

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)
"extraResources": [
  {
    "from": "./node_modules/node-adodb/lib/adodb.js",
    "to": "adodb.js"
  }
]
Tell the module where to find adodb.js while running from an asar package (I added this in electron's main.js file)
// Are we running from inside an asar package ?
if (process.mainModule.filename.indexOf('app.asar') !== -1) {
  // In that case we need to set the correct path to adodb.js
  ADODB.PATH = './resources/adodb.js';
}

Works like a charm now!

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda