Revised How-to for ODBC Databases: Jet/Access success

Barry Bird barry at ornithade.co.uk
Sat Jul 25 01:00:00 CDT 2009


Hello folks, after email conversation with James McKenzie, here is my 
revised how-to

Access 2000 can work with Wine, but this how-to doesn't require 
Microsoft Access.

How to set up Wine to enable Windows programs that read and write to Jet 
(Access)
databases using ODBC.  I write such programs in C and use the API defined in

ODBC API Reference
http://msdn.microsoft.com/en-us/library/ms714562%28VS.85%29.aspx

They work fine on Windows and only require Mingw to be installed to 
compile and link them,
both for console programs and those using Windows SDK.
You then can write interactive programs in C which use a full-featured 
SQL database which
comes bundled with Windows. No need to purchase Access.
With the set-up below they will also run on Linux (Kubuntu 9.04) and 
Wine 1.1.26.

Install Jet Service Pack 4.0 and MDAC 2.8 thus:

winetricks jet40 mdac28

You need to update the registry to 'install' the Access drivers for ODBC. 
Under Windows, export from the Registry to a *.reg file the registry entry
- HKLM\Software\ODBC
all subsidiary keys and values come with it.

You can carefully edit this file to remove drivers and DSNs you don't need.

Import this file using the registry editor in wine:

wine regedit.exe.

To use Windows ODBC drivers, you have to override Wine's odbccp32.dll 
and odbc32.dll with the native
versions because the Wine versions are currently wired directly to 
Linux's unixodbc.

Change the default setting for these DLLs using winecfg:
Select Default Settings in the Applications tab. Then in the Libraries 
tab, select each of
existing overrides for odbc32.dll and odbccp32.dll and edit them to be 
Native for Windows.

Bring across the programs and *.mdb database files from Windows.

If you need to set up (System) DSNs, enter

wine odbcad32.exe

this brings up the ODBC Data Source Administrator window as in the 
Windows Control Panel which you
can use in the normal way to enter a DSN name, select its driver and the 
.mdb file.

The programs should then run as they did in Windows but perhaps a bit 
slower with:

wine Odbc-prog.exe

I've tried this out on a clean .wine install and it works with my test 
programs.


Barry Bird





More information about the wine-devel mailing list