Operation is not allowed
I keep getting an Error message stating "Operation is not allowed when the object is closed". Any info on this error would be helpful.
var conn = ADODB.open('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=SampleDB.accdb;Persist Security Info=False;');
conn.query('SELECT Control_Number FROM [orders]')
.on('done', function(data) {
console.log('done');
console.log(JSON.stringify(data));
})
.on('fail', function(data) {
});
The new version 2.0.2 was available, please try it again!
I am facing same issue since few hours. I am already having version 2.0.2. Is anyone who accessed database MS ACCESS successfully !
Sorry for the delay, got pulled to another project. The new version still provides the same error message

@susnick @palakbhansali Can you upload an example? Thanks!
It should be related to Provider issue, but the error message cannot be displayed due to connection closed in /lib/adodb.js#L489-490 , comment this two lines to view the error message.
I ended up using a web api to provide the data from access, but was curious about this issue. I have since been using Windows 10, and everything works fine now. Possible issue with Windows 8.1???
I'm experiencing this same issue on Windows 2012 R2. I'm using the 64bit driver for Access.
var ADODB = require('node-adodb'), connection = ADODB.open('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Folder\\NameOfFile.accdb;');
ADODB.debug = true;```
I am facing the same issue, but thanks for inDream, after commenting /lib/adodb.js#L489-490, I finally found this issue.Here is how.
In my project, the folders and files is:
package.json
X.js
-server
att2000.mdb
demo.js
so in my demo.js ,here's the code:
connection = ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=./att2000.mdb;');
and I run node like this:
node server/demo
Then this error occured.
After commenting /lib/adodb.js#L489-490, the message becomes "找不到文件 'G:....\att2000.mdb"(which means file not found).
So the solution for me is to change the code like this:
connection = ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=server/att2000.mdb;');
My issue is 32 bit vs 64 bit. It appears the module supports 32bit oledb and not 64 bit. When I removed the 64 bit driver and installed the 32 bit driver the module worked fine.
IIS7+iisnode 运行报错
{ "valid": false, "message": "Unexpected token '" }
不管运行什么sql都是一样的错误
连接代码,windows7 64位系统
ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;');
@getpro 源码中的示例能跑起来吗?
I had the same issue, Thanks to @inDream ! In the last version, you have to comments these lines to display the real error message : /lib/adodb.js:496 -> //recordset.Close(); /lib/adodb.js/497 -> //connection.Close();
The fix for me was to change
var conn = ADODB.open('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=SampleDB.accdb;');
to
var conn = ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=SampleDB.accdb;');
I'm running Win server 2016, [email protected]. Installed the 64 bit version of "Microsoft Access Database Engine 2010 Redistributable". After commenting the lines indicated by @inDream and @Spaarw I get the error "The specified provider could not be found. It may not be installed correctly. ".
The bug seems related to the bit version selection of cscript.exe.
The fix for me was to comment the lines 18, 19 in file "proxy.js"
// x64 = fs.existsSync(path.join(sysroot, 'SysWOW64')),
// cscript = path.join(sysroot, x64 ? 'SysWOW64' : 'System32', 'cscript.exe');
and let the system select the cscript version adding the line
cscript = 'cscript'
Thanks @nuintun. Your library is helpful for me.
Hi, I'm having this same issue After following @inDream advice, the messages I get are as follows:
When running: ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=myDB.accdb;');
I get the error: Unrecognized database format
When running: ADODB.open('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=myDB.accdb;');
I get the error: Provider cannot be found. It may not be properly installed
I also tried @onaxon suggestion, but that threw a marge larger error...
Can anyone advise me how to fix this? Thanks, David
My environment is as follows:
- Windows 10 64 bit
- MS Access 2016 32 bit
- NodeJS 6.9.1 (64 bit)
- [email protected]
@DaveyD You could try use Provider=Microsoft.ACE.OLEDB.16.0
Ref: http://stackoverflow.com/a/32247214
@inDream - Thanks a lot for your response
I tried what you provided but I'm still getting the same results.
Here is the output:
Params: {
"connection": "Provider=Microsoft.ACE.OLEDB.16.0;Data Source=D:\\Documents\\myData.accdb;",
"sql": "SELECT * FROM Table1"
}
Error: {
"valid": false,
"message": "Provider cannot be found. It may not be properly installed."
}
I later ran the powershell command provided in the SO link that you presented and it returned:
Microsoft.ACE.OLEDB.12.0 Microsoft Office 12.0 Access Database Engine OLE DB Provider
So it seems like I have the 12.0 version.
Any other ideas? Thanks, David
I got it to work! The problem was that I had installed the 64bit Access Database Engine, but since my Access was 32bit I had to install the 32bit version. Seems simple and silly... but took me quite a lot of time!! Hope this helps others
@nuintun - Thanks for this library!
since I had the same issue and try to install 32-bit version on Office 64-bit throws an error, I want to share how I installed 32-bit version of the engine:
in cmd run the
AccessDatabaseEngine.exe /quiet
and all start to work.
thanks for the help.