Can't connect to Access Database in 64 bit compile

This code works in 32 bit compile but not in 64 bit -
connectionString = “DRIVER={Microsoft Access Driver (*.mdb)};”
connectionString = connectionString + “DBQ=” + sourceFilepath + “;” //specify your own path to file here
connectionString = connectionString + “UID=;PWD=password;” //enter the user ID and password here
dbCav.DataSource=connectionString
if dbCav.Connect then …

// I receive a message - [Microsoft ODBC Datasource] name not found and no default driver specified"

It sounds like the “Microsoft Access Driver” on your machine is not 64-bit.

Thanks I’m at my work computer at present so can’t install anything but will try this when I’m home -
https://www.microsoft.com/en-us/download/details.aspx?id=13255

1 Like

Unfortunately I was unable to install AccessDatabaseEngine _x64 because I have some 32 bit Office products on my PC which rely on the 32 bit Access Database Engine. It won’t continue until they are removed.

I only want to add a data import function for Access to my 64 bit program but it might be simpler to compile a separate 32 bit program to do this and include it with my distribution.

Hello Craig,

Maybe try the /quiet switch for 64-bit MS Access. Here is a link to a similar question on another forum, and the solution that worked for users: Installing the Microsoft.ACE.OLEDB.12.0 Provider for Both 64-bit and 32-bit Processing – Data Savvy

Edit: You may need to install both 32-bit and 64-bit drivers for Microsoft Access. Using the /quiet parameter will allow both drivers to be installed.

Well the driver’s bitness needs to match so you’ll need to have both without screwing up the user’s machine. I don’t envy you that job.

Been there, done that, got the t-shirt.

1 Like

FWIW, It might be easier to build your tool as 32-bit.

1 Like

is there a way to connect 32bit MS Access in a 64bit Xojo App??

The problem isn’t access, it’s the driver. And the driver has to match the Xojo app.

No. That’s actually the challenge. Same for the Office automation plugin in Xojo. Either everything (your app, driver, office) has to be 64- or 32-bit.

Or you have to deal with it through an installer routine, means either installing 32-bit or 64-bit version after your installer had checked which Office version is installed … (which might change after your installation - unlikely though, but I have seen that as well - for instance when the admin realized that he / she installed the wrong version of Office …).

Agreed! definitely the last thing I want to be responsible for.
Even though there’s plenty of testimony that the command line install can work with the passive switch one user has stated that when you repair office and it detects the 32 bit driver it will remove 64 bit office from your computer completely.
Asking users to perform a fix to their present system so your app can work is a big ask. It needs to be a simple operation with no consequences down the track.

1 Like