My c# application cannot connect to database on window7 64bit with microsoft access database engine 2010 32bit - ms-access

I'm working with
1) Window7 32bit
2) VS 2005
3) language: C#
I made an application that connects to an Access file and deployed the applicatioin with Clickonce on my computer.
I published in release/any cpu mode.
The prerequisites was .Net Framework 2.0.
When I installed the appliction on another computer (Window7 64bit, MS Access Database Engine 2010 32bit), an error occurred.
The error message was Cannot Connect to Database.... System.Data.
My connection string is Provider=Microsoft.ACE.OLEDB.12.0;Data Source=....

64-bit and 32-bit components don't play well together.
I had a similar issue with 64-bit Windows and a 32-bit ODBC driver. You most likely need the 64-bit version of the Access database driver.

Related

Front end (installed Access 365 32 bit with ODBC MySql BE) won't open for 64 bit users

My development computer has Installed 32-bit Access (Office 365). I now have users with 64-bit Access who cannot open the application. Is there any way to install 64-bit (either Runtime or full) for debugging purposes? So frustrating!
You have to convert your application to 64bit Access
This is done by obtaining a Ms Access 64bit (Office) ..opening your application on it and working out any bitness differences.. and of course providing the appropriate driver for MySQL : https://cdn.mysql.com//Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.14-winx64.msi

Missing ACCDB database drivers

Please explain this one to me ....
I am on a x64 bit computer (well, not literally standing on it :) ). And I have Office x64 installed, including x64 Microsoft Access.
Using Access I can open ACCDB and MDB files. yet, if I run the x64 ODBC Drivers component there is NO Microsoft Access Database (*.mdb, *.accdb) driver listed.
The only way I can get it listed is if I install the x64 Access 2013
Runtime. Then it shows up.
Why is it not showing if I have access only installed?
Basically, I am trying to detect if my own executable is going to be able to open the ACCDB database OK. I do that by examining what drivers are installed.
I had the same problem on a 64 bit Windows 10 system with 64 bit Office 2016. I was missing 64 bit ODBC Access drivers. Listing drivers (from Python's pyodbc module) showed only:
'SQL Server'
'PostgreSQL ODBC Driver(ANSI)'
'PostgreSQL ODBC Driver(UNICODE)'
I installed the Microsoft Access Database Engine 2016 Redistributable from Microsoft's site and it came with the extra drivers needed. I could then list:
'SQL Server'
'PostgreSQL ODBC Driver(ANSI)'
'PostgreSQL ODBC Driver(UNICODE)'
'Microsoft Access Driver (*.mdb, *.accdb)'
'Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)'
'Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)'
'Microsoft Access Text Driver (*.txt, *.csv)'
And I was able to query an accdb file using the ODBC drivers from Python.
Downloading from the Microsoft Access Database Engine 2016 Redistributable at https://www.microsoft.com/en-us/download/confirmation.aspx?id=54920 also worked for me. It may go without saying, but I think it's worth noting that if your application/executable uses 32-bit drivers and you download the 64-bit Access Database Engine, the 32-bit application/executable may not recognize the Microsoft Access Database (*.mdb, *.accdb) driver.

Trying to connect to an access with a UDL file

I'm trying to connect to an Access database via a UDL file. I'm wanting to generate a connection string so that I can connect to an access database via ADO.NET. It's been a few years since I've tried to do this.
I have Visual Studio 2015 Pro and Microsoft Access 2016 installed on my Windows 10 x64 pro machine. When I create a .udl file I have the following available options:
Microsoft OLE DB Provider for ODBC Drivers
Microsoft OLE DB Provider for Search
Microsoft OLE DB Provider for SQL Server
Microsoft OLE DB Simple Provider
MSDataShape
OLE DB Provider for Microsoft Directory Services
SQL Server Native Client 11.0
I think that in years past I would also see Microsoft Jet 4.0 OLE DB in this list. From the research I've done I think that Jet 4.0 is deprecated and that I should be using the Access Database Engine. I find the following versions that I think are that:
Microsoft Access Database Engine 2010 Redistributable
Microsoft Access 2013 Runtime
Microsoft Access 2016 Runtime
I downloaded the x64 version of Microsoft Access 2016 Runtime and when I try to install it I get the following error:
We can’t install the 64-bit version of Office because we found the following 32-bit programs on your PC:
Office 16 Click-to-Run Extensibility Component
Please uninstall all 32-bit Office programs, then retry installing 64-bit Office. If you want to install 32-bit Office instead, please run the 32-bit setup.
I've tried the 32-bit version of the Microsoft Access 2016 Runtime and I get the same message:
We can’t install the 32-bit version of Office because we found the following 64-bit programs on your PC:
Office 16 Click-to-Run Extensibility Component 64-bit Registration
Please uninstall all 64-bit Office programs, then retry installing 32-bit Office. If you want to install 64-bit Office instead, please run the 64-bit setup.
I've tried closing all open Microsoft Office and Visual Studio applications and I get the same error. Am I installing the right component? Any way to get it to install correctly?
You probably miss the ACE driver listed here - and only this, not the runtimes:
Microsoft Access Database Engine 2010 Redistributable

Classic ASP + Access DB not working on Windows Server 2012

I tried to migrate my Classic ASP application with its Access DB from Windows 7 Professional to Windows Server 2012.
For standard script without accessing access db, it's working fine.
But I got error when the script use access db, by the following:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified /includes/public.asp, line 64
Here is my connection string
strConn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("../private/apps.MDB")
In application pool, I've set
.NET Framework Version = No Managed Code
Enable32Bit Application = True
ManagedPipelineMode = Classic
What am I doing wrong?
The "Microsoft Access Driver" is the desktop driver installed when Office Access or the Office Access Redistributable is installed, it is not intended for use in server-side applications. The current Access driver is also known as ACE (Access Connectivity Engine) and replaces the JET engine for single-user desktop applications only.
Instead, please use the JET 4.0 OLEDB or ODBC driver (ODBC is preferred). This driver is included in MDAC which comes with Windows Server out-of-the-box. The connection string template is this:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\somepath\myDb.mdb;
OR
Provider=Microsoft.Jet.ODBC.4.0;Data Source=c:\somepath\myDb.mdb;
Note that the JET 4.0 driver is only available in 32-bit mode (but you've already set your application-pool to 32-bit so this won't be an issue).
Note that JET is effectively obsolete at this point (its successor, ACE, is only intended for use in single-user desktop applications) as evidenced by its availability only in 32-bit versions. Server-side and multi-user applications should use SQL Server (SQL Server now supports "LocalDb"-mode which introduces a simpler working experience, similar to Access, and it's available in Express Edition). If you absolutely need something simple and low-resource I would suggest SQLite, however you will be responsible for using the SQLite API correctly in a multithreaded/concurrent environment like a webserver (including Classic ASP).
Update:
I'll revise my answer to warn that using LocalDb with ASP.NET, or server applications in general, is inadvisable - and of little point, actually - if you're using LocalDb then you already have SQL Server installed, and if you already have SQL Server installed then you might as well use it in "normal mode" rather than LocalDb mode.

Using the correct mySQL ODBC driver in windows

I am trying to connect MS Access with a local mySQL database.
To do this I downloaded the mySQL ODBC connector from the mySQL website and installed it. As I am on a 64-bit system I went for the 64-bit version.
I then discovered when trying to connect Access to mySQL that my installation of Office is actually 32-bit so the driver doesn't work. So I removed the 64-bit ODBC driver and installed the 32-bit one.
Problem is, when I go into control-panel -> Administrative Tools -> Data Sources (ODBC) and try to add a new data source, the only options for the mySQL drivers seem to point to the old directory where the 64-bit drivers were. It then fails as it can't find the dlls with system error 126.
How do I get it to show the 32-bit drivers?
Run the 32-bit manager by running this command:
c:\windows\syswow64\odbcad32.exe
Also you can use RegisterDatabase() function to create connection from your code.
I wrote wrapper function many years ago:
http://5codelines.net/kak-programmno-sozdat-odbc-dsn/.
Just skip russian language and use the code.
Prior to installing the ODBC MySQL driver 5.2.6 you need to install the Microsoft Visual C++ 2010 Redistributable Package for x64 or x86 or both (just search the Microsoft site for these and download from there). Other driver versions may require different versions of this MS VC++ Redist. Package, which can coexist side by side. By default server 2008 R2 comes with the 2008 version, so installing the 2010 is required. Before installing check in Programs and Features if not already installed. Depending on you application it may require the 32 bit or the 64 bit version. Without it you get the system error 126
Then install the drivers:
To install the 32 bit version run as administrator c:\windows\syswow64\odbcad32.exe which is the 32 bit version of "Data Sources (ODBC)"