I am having an issue with my code that uses node-adodb.js
to read .mdb files. When I run the code on runtime, it works perfectly, but when I build it and run the exe, I get the following error:
Spawn C:\WINDOWS\SysWOW64\cscript.exe error
{“exitMessage”:“Uncaught Fatal Exception”,“exitCode”:1}
I have made some changes, but they do not seem to work (changes).
My versions are as follows:
- node v12.12.0
- electron-builder@21.2.0
- electron@6.1.7
- vue-cli-plugin-electron-builder@1.4.4
The code used is:
const db = require('node-adodb')
ipcMain.on('query', (e, p) => {
if (!p) return
appendFileSync('a.log', new Date().getTime() + ' ' + p.table + ' \r\n')
let conn = db.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + p.path)
conn.query('select ID,品种,批号,日期,包重,条码 from ' + p.table + ' order by ID')
.then(data => {
e.sender.send('result', data)
appendFileSync('a.log', data.length + ' ' + p.table + ' \r\n')
})
.catch(err => {
appendFileSync('a.log', JSON.stringify(err) + ' \r\n')
})
})
The package.json
includes:
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
},
"asar": false,
"extraResources": [
{
"from": "./node_modules/node-adodb/lib/adodb.js",
"to": "adodb.js"
}
],
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
Is there anyone who can help me with this issue?