ODBC Databases Jet Access success with Wine 1.1.26 PDF Print E-mail
Written by Tom Wickline   
Thursday, 23 July 2009 21:16
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.

I hope someone finds this useful.

Barry Bird

Del.icio.us     Digg This!     Furl     Google     Seed Newsvine     Reddit     Slashdot     Stumble It!     Technorati     Yahoo MyWeb

Comments
Add New Search RSS
sidac 2009-08-25 21:55:34

i have read it, and maybe it's useful to me, thank you.
works perfectly
David Mansfield 2009-10-13 05:12:19

Although it doesn't work with 1.1.29 due to a known regression (winetricks install of MDAC fails),
under 1.1.28 this works perfectly. I was able to use this to read from an MDB file using
ActiveState perl under wine, using DBD::ODBC. Fantastic!
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
Text:

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 

Latest Comments

Most Comments

Stats

Statistics

Members : 6
Content : 552
Content View Hits : 1396358
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday1573
mod_vvisit_counterYesterday1927
mod_vvisit_counterThis week1573
mod_vvisit_counterThis month15734
mod_vvisit_counterAll1060993