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

Provider error #139

Open
hosseinakbariann opened this issue Apr 30, 2019 · 10 comments
Open

Provider error #139

hosseinakbariann opened this issue Apr 30, 2019 · 10 comments

Comments

@hosseinakbariann
Copy link

I have an error in execution this module for reading access file.

{"code":-2146824582,"message":"Provider cannot be found. It may not be properly installed."}

what is that mean?

@SkeletonGamer
Copy link

Hi,

It is mean that the Access Database Engine is not found by node-adodb.

If you have installed x64 version of the engine, you should use :

const connection = ADODB.open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=node-adodb.mdb;', true);

API:
ADODB.open(connection[, x64]): ADODB

Initialization database link parameters.

@jonaszuberbuehler
Copy link

@SkeletonGamer Maybe you can help me (I'm facing the same problem). I'm running on Windows 10 64bit with MS Office 365 64bit and I installed the MS Access Database Engine 2016 (found here https://www.microsoft.com/en-us/download/details.aspx?id=54920). No matter what connection string I use, it always ends in an error:

ADODB.open('Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=test.accdb', true)

{
  "code": -2147217865,
  "message": "[Microsoft][ODBC Excel Driver] The Microsoft Access database engine could not find the object 'TestTable'. Make sure the object exists and that you spell its name and the path name correctly. If 'TestTable' is not a local object, check your network connection or contact the server administrator."
}

TestTable exists and can be queried w/o problems in Access directly. Do you have any idea?

@SkeletonGamer
Copy link

@jonazuberbueler You want to connect Access database with Excel ODBC connector. It is normal that is does not work.

You should use :

ADODB.open('Provider=Microsoft.ACE.OLEDB.15.0;Data Source=test.accdb;Persist Security Info=False;', true)

@jonaszuberbuehler
Copy link

jonaszuberbuehler commented Aug 22, 2019 via email

@jonaszuberbuehler
Copy link

Apparently the I tried connecting to was created with a newer version of Access. When I create a new DB on the machine I'm working on it all works perfectly...

@ajjack50n
Copy link

ajjack50n commented Mar 15, 2021

Hi I am having the same issue. All works fine with 2003 provider and mdb files but I cannot open an accdb file. I have installed the latest redistributable - several times!:)
I have tried links for 2010 and 2016 redistributables. Both seem to install but no effect.

I have tried all of the following strings...

Provider=Microsoft.ACE.OLEDB.16.0;Data Source=test2.accdb; Persist Security Info=False;
Provider=Microsoft.ACE.OLEDB.15.0;Data Source=test2.accdb; Persist Security Info=False;
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=test2.accdb; Persist Security Info=False; 

I just cannot get to work. Anybody any ideas what I could be doing wrong?

Further...

I have used PowerShell to confirm the OLE Provider is installed...

enumerated,,,

foreach ($provider in [System.Data.OleDb.OleDbEnumerator]::GetRootEnumerator())

with following output confirmed...

SOURCES_NAME        : Microsoft.ACE.OLEDB.12.0
SOURCES_PARSENAME   : {3BE786A0-0366-4F5C-9434-25CF162E475E}
SOURCES_DESCRIPTION : Microsoft Office 12.0 Access Database Engine OLE DB Provider
SOURCES_TYPE        : 1
SOURCES_ISPARENT    : False
SOURCES_CLSID       : {3BE786A0-0366-4F5C-9434-25CF162E475E}

SOURCES_NAME        : Microsoft.ACE.OLEDB.16.0
SOURCES_PARSENAME   : {3BE786A2-0366-4F5C-9434-25CF162E475E}
SOURCES_DESCRIPTION : Microsoft Office 16.0 Access Database Engine OLE DB Provider
SOURCES_TYPE        : 1
SOURCES_ISPARENT    : False
SOURCES_CLSID       : {3BE786A2-0366-4F5C-9434-25CF162E475E}

Stuck don't know how to proceed .,, any help greatly received.

@ajjack50n
Copy link

OK, so I solved my problem. Putting it here in case anyone has same issue. It seems that the library has a dependency on on the 32 bit version of the MS Access redistributable!

@HaydnG
Copy link

HaydnG commented Apr 6, 2021

Could you tell me abit more about how you fixed it please.

@ajjack50n
Copy link

Follow this link to download the necessary redistributable but make sure you select the 32 install and not the X64 when you are presented with the option.

I had to spend a little time on my system removing the different X64 systems I had already installed first.

@imjosh
Copy link

imjosh commented Mar 15, 2024

I just ran into this issue. Running this command in both the 32-bit and 64-bit versions of Powershell, I discovered that one of my machines had the 64-bit, but not 32-bit version of the provider:

PS C:> (New-Object system.data.oledb.oledbenumerator).GetElements() | select SOURCES_NAME, SOURCES_DESCRIPTION

The solution:

const isX64 = true;
const providerString = `Provider=Microsoft.ACE.OLEDB.12.0;Data Source=${msAccessDbPath};Persist Security Info=False;`;
const connection = ADODB.open(providerString, isX64);

My other machine had no 64-bit providers, but it had 32-bit versions of both 12.0 and 16.0. Either version, 12 and 16, seemed to work for me:

image

const isX64 = false;
const providerVersion = '16.0'; // or '12.0'
const providerString = `Provider=Microsoft.ACE.OLEDB.${providerVersion};Data Source=${msAccessDbPath};Persist Security Info=False;`;
const connection = ADODB.open(providerString, isX64);

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

6 participants