ACE Provider issue with WB

Started by spl, February 18, 2024, 05:19:44 AM

Previous topic - Next topic

spl

This fails in WB [32 or 64 bit execution], although Provider is registered, works fine in PS and even via an Excel macro [different code syntax but same context]. I just moved to a Win11 laptop, but this was failing on my older Win10 Surface Pro. Using WB 2022C.

Code (WINBATCH) Select

cACCDB = "C:\samples\Contoso.accdb" ; basic Microsoft test db, change for your needs
cConn="Provider=Microsoft.ACE.OLEDB.16.0;data source=":cACCDB

oConn = CreateObject("ADODB.Connection")
oConn.Open(cConn)

Message("Opened",oConn)
oConn.Close()
oConn=0
Exit
Stan - formerly stanl [ex-Pundit]

td

Your WinBatch script works on my Windows 11 system but then I have multiple versions of Access installed. Your sacred PS is not relevant to the problem since PS uses a different ABI.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

Not sure if this is relevant but here is a link to "Access Database Engine 2016 Redistributable".

https://www.microsoft.com/en-us/download/details.aspx?id=54920

If you do try to install it you may need to do so from the command line.

Here is a link to a discussion of the topic on Stack Overflow:

https://stackoverflow.com/questions/40360932/microsoft-ace-oledb-16-0-provider-is-not-registered-on-the-local-machine-sys


Again I am not sure how relevant this is to your problem as I can't duplicate it.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

spl

Thanks;

The AccessDatabaseEngine 2016 was installed but not from command line. I have Office 2016. I should have mentioned error is recent and had no issues with Ace.16 Provider before. I'll keep trying.
Stan - formerly stanl [ex-Pundit]

spl

Quote from: spl on February 19, 2024, 02:58:17 AM
Thanks;

The AccessDatabaseEngine 2016 was installed but not from command line. I have Office 2016. I should have mentioned error is recent and had no issues with Ace.16 Provider before. I'll keep trying.

I ended up running cmd as admin, executed the 2010 accessdbengine with /passive and changed script to use Ace.12 and worked fine for script w/out affecting using Ace.16 for other scripts.

Off Topic: when I was stanl the thread posts were ordered from last message to initial message, as spl the order is now first=>last. Is there a way to go back to last=>first?
Stan - formerly stanl [ex-Pundit]

td

From the menu bar Profile->Look and Layout->Show most recent posts at the top.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade