Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-adodb Error: Spawn C:\Windows\SysWOW64\cscript.exe #85

Closed
PedroCieemg opened this issue Sep 3, 2018 · 11 comments
Closed

node-adodb Error: Spawn C:\Windows\SysWOW64\cscript.exe #85

PedroCieemg opened this issue Sep 3, 2018 · 11 comments

Comments

@PedroCieemg
Copy link

PedroCieemg commented Sep 3, 2018

Good afternoon, I'm having this error and I did some procedures to solve it, but I did not get many results, does anyone know how to solve it?

code below

`const ADODB = require('node-adodb');
ADODB.debug = true;

// Connect to the MS Access DB
const connection = ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\192.168.0.4\banco_teste\DBCIEE.mdb;');
// Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\192.168.0.4\BANCO\DBCIEE.mdb;Persist Security Info=False

//Query the DB
async function query() {
try{
const users = await connection.query('SELECT * FROM CIEE01');

    console.log(JSON.stringify(users, null, 2));
}catch(error){
    console.error(error);
}

}

query();`

Thank's

@PedroCieemg PedroCieemg changed the title node-adodb Error: Spawn C:\Windows\SysWOW64\cscript.exe node-adodb Error: Spawn C:\Windows\SysWOW64\cscript.exe Sep 3, 2018
@FelixNose
Copy link

FelixNose commented Oct 10, 2018

I'm facing the same issue and couldn't solve it yet even after trying various things (I'm using iisnode on windows servers)

@FelixNose
Copy link

I managed to solve the issue when running it in cmd.exe.
For that I made sure to run the correct access drivers (x64 in my case) and I changed the .execute line from the example to:
.execute("INSERT INTO Users(UserName, UserSex, UserAge) VALUES ('Newton', 'Male', 25)");
(exchanged single quotes and double quotes)

Sadly it still doesn't run in iisnode and gives the same error there as it previously did.

@simonlampen
Copy link

You can get this error if anything in your connection string is incorrect.
eg: it looks like your connection string is not escaped, it should have the backslashes escaped

wrong    "Provider=Microsoft.Jet.OLEDB.4.0; c:\data\my.mdb;"
correct  "Provider=Microsoft.Jet.OLEDB.4.0; c:\\data\\my.mdb;"

@RoelVB
Copy link

RoelVB commented Nov 1, 2018

Do console.error(JSON.stringify(error)) instead of console.error(error). This could give you some extra information.

@nuintun nuintun closed this as completed Feb 27, 2019
@rabbitom
Copy link

I got the same error, and it turns out that I spelt the table name wrong in SQL.

@dallascao
Copy link

It's annoying. Struggling with the issue

It seems the following worked.

  1. Single quote the Data Source.
  2. Set 64 bit to false, though my Windows is 64 bit.

ADODB.open(Provider=Microsoft.ACE.OLEDB.12.0;Data Source='c:\\users\\put files in quotes';, false)

  1. Also be aware that single quotes need to escaped with two single quotes.
    const mySql =UPDATE Pairs SET Target_1036 = 'what the l'fck fckfckfckfck!' WHERE ID = '0000885' //give error

const mySql =UPDATE Pairs SET Target_1036 = 'what the l''fck fckfckfckfck!' WHERE ID = '0000885' //works

@mohamadfg-dev
Copy link

use this code :

    const ADODB = require('node-adodb');
    // ADODB.debug = true;
    const connection = ADODB.open('Provider=Microsoft.ACE.Oledb.12.0;Data Source=C:\\databases\\DB.accdb;', process.arch.includes('64'));
    
    connection.query('SELECT * FROM Table1').then(data => {
        console.log(JSON.stringify(data));
    }).catch(error => {
        console.error(JSON.stringify(error))
    });

@ghost
Copy link

ghost commented Mar 11, 2022

The code above for me does not work, I get:

TypeError: Cannot read properties of undefined (reading 'includes')

@RoelVB
Copy link

RoelVB commented Mar 11, 2022

@Mark-81 that would mean for some reason process.arch is undefined.
You could try replacing process.arch.includes('64') with true (or false if you're on 32-bit)

@idodidodi
Copy link

This solved my issue:
Changing the provider from
Provider=Microsoft.ACE.OLEDB.12.0

To:

Provider=Microsoft.Jet.OLEDB.4.0

@jant-gg
Copy link

jant-gg commented May 13, 2024

same for me, i was trying to use 32bits while i'm at 64:
const ADODB = require('node-adodb');
ADODB.debug = true; // Activar depuración si necesitas ver más detalles en las operaciones

// Cambia la ruta a la ubicación de tu archivo de base de datos Access
const connection = ADODB.open('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Juan\Documents\Dbprueba.accdb;', process.arch.includes('64'));

module.exports = connection;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants