Discussion:
ODBC Databases: Jet/Access success
Barry Bird
2009-07-23 15:49:28 UTC
Permalink
Good Afternoon.

In section 3.3.6.2 of your User Guide you ask readers to report
successes with databases other than MS SQL. Well here's one (I know
Access 2000 can work with Wine, but this doesn't require 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.

You need to update the registry to install the Access drivers.
Under Windows, export from the Registry to *.reg files the registry entries
- HKLM\Software\ODBC
- HKLM\Software\Microsoft\Jet
all subsidiary keys and values come with them.

You can carefully edit these files to remove drivers and DSNs you don't
need.

Import these files using the registry editor in wine:

wine regedit.exe.

You need to bring across from Windows to Windows\System32 under wine:

clbcatq.dll
comres.dll
expsrv.dll
msjet40.dll
mswstr10.dll
msjter40.dll
msjint40.dll
msjtes40.dll
msrd3x40.dll
odbc32.dll
odbccp32.dll
odbcji32.dll
odbcjt32.dll
odbcad32.exe
odbcint.dll
odbctrac.dll
vbajet32.dll

Register this server in wine:
wine regsvr32.exe msjtes40.dll

No need to install MDAC.

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.

This can be done by setting up the ODBC Data Source Administrator
odbcad32.exe using winecfg:
- Add the program to the Applications tab
- then in the libraries tab, pick from 'New override for library' drop-down
odbc32.dll and odbccp32.dll add them and edit them to be Native for Windows.

Then if you do

wine odbcad32.exe

this brings up the ODBC Data Source Administrator window as in the
Windows Control Panel

If needed, set up (System) DSNs using this program.

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

Using winecfg, you need to set up each program you want to run with
overrides for odbc32.dll and odbccp32.dll
(Applications and Libraries tabs) as above.

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

wine Odbc-prog.exe

This has been tested twice on a clean .wine install. I cannot vouch
for support of all API and SQL facilities however.

I hope someone finds this useful.

Barry Bird
Juan Lang
2009-07-24 02:32:43 UTC
Permalink
Hey Barry,

this was a handy writeup. Perhaps you could add it to the wiki?
Here's a page that you might add it to:
http://wiki.winehq.org/NativeOdbc

The user guide should probably point to the wiki, but that's a
different topic. Thanks!
--Juan
Mike Kaplinskiy
2009-07-24 04:04:50 UTC
Permalink
Post by Juan Lang
Hey Barry,
this was a handy writeup.  Perhaps you could add it to the wiki?
http://wiki.winehq.org/NativeOdbc
The user guide should probably point to the wiki, but that's a
different topic.  Thanks!
--Juan
Dan/Austin might also add this to winetricks. Jet is already in there
so this would be a nice addition.

Mike.
Austin English
2009-07-24 05:04:58 UTC
Permalink
On Thu, Jul 23, 2009 at 11:04 PM, Mike
Post by Mike Kaplinskiy
Post by Juan Lang
Hey Barry,
this was a handy writeup.  Perhaps you could add it to the wiki?
http://wiki.winehq.org/NativeOdbc
The user guide should probably point to the wiki, but that's a
different topic.  Thanks!
--Juan
Dan/Austin might also add this to winetricks. Jet is already in there
so this would be a nice addition.
I don't see how. The dlls were copied from windows, not part of a
redistributable downloadable package.
--
-Austin
James Mckenzie
2009-07-24 14:23:41 UTC
Permalink
Post by Austin English
On Thu, Jul 23, 2009 at 11:04 PM, Mike
Post by Mike Kaplinskiy
Post by Juan Lang
Hey Barry,
this was a handy writeup.  Perhaps you could add it to the wiki?
http://wiki.winehq.org/NativeOdbc
The user guide should probably point to the wiki, but that's a
different topic.  Thanks!
--Juan
Dan/Austin might also add this to winetricks. Jet is already in there
so this would be a nice addition.
Austin:

Can his list be bounced against the Jet40 and MDAC28 installations?

James McKenzie
Post by Austin English
I don't see how. The dlls were copied from windows, not part of a
redistributable downloadable package.
--
-Austin
Barry Bird
2009-07-24 20:21:26 UTC
Permalink
You'll find my list is a subset of Jet40, plus odbc files. I tried to
get Jet 4.0 SP8 from
http://support.microsoft.com/kb/239114
but failed. I don't think there is a Jet 4.0 SP8 as such any longer.
It's all in the form of hotfixes. I have Windows XP SP3 to which I have
some time ago updated with Jet 4.0 SP8. I downloaded
WindowsXP-KB829558-x86-ENU.exe as that article says, set wine to Windows
XP and executed
wine WindowsXP-KB829558-x86-ENU.exe
It refused to run, saying my version of XP was already ahead of where it
was trying to update to.

Later down the Microsoft page it says:

"...the ODBC Desktop Driver Pack drivers. These drivers are included
with the Windows 2000 operating system, the Windows XP operating system,
and the Windows Server 2003 operating system."

This article
http://support.microsoft.com/kb/271908/
says
"MDAC version 2.6 and later do not contain Jet or Desktop ODBC drivers"

so it seems the latest MDAC's no use, so I use my list of files from my
WinXP installation. I may have missed something, but that's the way it
seems it has to be. Do you really want to go back to MDAC 2.5?

It may be that to fully support all features of JET databases and ODBC
there are some other DLLs (look at
http://msdn.microsoft.com/en-us/library/ms810823.aspx) which should also
be added. What I gave is a minimum set to get my programs to work.

Barry
Post by James Mckenzie
Post by Austin English
On Thu, Jul 23, 2009 at 11:04 PM, Mike
Post by Mike Kaplinskiy
Post by Juan Lang
Hey Barry,
this was a handy writeup. Â Perhaps you could add it to the wiki?
http://wiki.winehq.org/NativeOdbc
The user guide should probably point to the wiki, but that's a
different topic. Â Thanks!
--Juan
Dan/Austin might also add this to winetricks. Jet is already in there
so this would be a nice addition.
Can his list be bounced against the Jet40 and MDAC28 installations?
James McKenzie
Post by Austin English
I don't see how. The dlls were copied from windows, not part of a
redistributable downloadable package.
--
-Austin
James McKenzie
2009-07-25 00:01:33 UTC
Permalink
[Bottom post please, that's how we do things here.]
Post by James Mckenzie
Post by Austin English
On Thu, Jul 23, 2009 at 11:04 PM, Mike
Post by Mike Kaplinskiy
Post by Juan Lang
Hey Barry,
this was a handy writeup. Â Perhaps you could add it to the wiki?
http://wiki.winehq.org/NativeOdbc
The user guide should probably point to the wiki, but that's a
different topic. Â Thanks!
--Juan
Dan/Austin might also add this to winetricks. Jet is already in there
so this would be a nice addition.
Can his list be bounced against the Jet40 and MDAC28 installations?
James McKenzie
Post by Austin English
I don't see how. The dlls were copied from windows, not part of a
redistributable downloadable package.
--
-Austin
You'll find my list is a subset of Jet40, plus odbc files. I tried to
get Jet 4.0 SP8 from
http://support.microsoft.com/kb/239114
but failed. I don't think there is a Jet 4.0 SP8 as such any longer.
It's all in the form of hotfixes. I have Windows XP SP3 to which I have
some time ago updated with Jet 4.0 SP8. I downloaded
WindowsXP-KB829558-x86-ENU.exe as that article says, set wine to Windows
XP and executed
wine WindowsXP-KB829558-x86-ENU.exe
It refused to run, saying my version of XP was already ahead of where it
was trying to update to.

Later down the Microsoft page it says:

"...the ODBC Desktop Driver Pack drivers. These drivers are included
with the Windows 2000 operating system, the Windows XP operating system,
and the Windows Server 2003 operating system."

This article
http://support.microsoft.com/kb/271908/
says
"MDAC version 2.6 and later do not contain Jet or Desktop ODBC drivers"

so it seems the latest MDAC's no use, so I use my list of files from my
WinXP installation. I may have missed something, but that's the way it
seems it has to be. Do you really want to go back to MDAC 2.5?

It may be that to fully support all features of JET databases and ODBC
there are some other DLLs (look at
http://msdn.microsoft.com/en-us/library/ms810823.aspx) which should also
be added. What I gave is a minimum set to get my programs to work.

Barry:

We talk about winetricks here because Dan Kegel and Austin English put a
lot of time into it to make it work.

For Jet/Access database use, I retrieve the winetricks script, save it
as a file, make it executable (that may be because I'm using a Mac).
Since I use a Mac I have to open a terminal session and type in:

./winetricks jet40 mdac28

This retrieves the Jet Engine version 4.0 and MDAC 2.8.

I would have to check if MDAC includes the ODBC frontend, but it
probably does not. I don't think that it would be legal to copy the
ODBC front end from Windows, but then again a replacement program might
be available.

I am going to get you list and then use a clean wineprefix to see how
much of what you installed is installed with these two updates.

James McKenzie
Barry Bird
2009-07-25 05:18:18 UTC
Permalink
Post by Barry Bird
[Bottom post please, that's how we do things here.]
Post by James Mckenzie
Post by Austin English
On Thu, Jul 23, 2009 at 11:04 PM, Mike
Post by Mike Kaplinskiy
Post by Juan Lang
Hey Barry,
this was a handy writeup. Â Perhaps you could add it to the wiki?
http://wiki.winehq.org/NativeOdbc
The user guide should probably point to the wiki, but that's a
different topic. Â Thanks!
--Juan
Dan/Austin might also add this to winetricks. Jet is already in there
so this would be a nice addition.
Can his list be bounced against the Jet40 and MDAC28 installations?
James McKenzie
Post by Austin English
I don't see how. The dlls were copied from windows, not part of a
redistributable downloadable package.
--
-Austin
You'll find my list is a subset of Jet40, plus odbc files. I tried to
get Jet 4.0 SP8 from
http://support.microsoft.com/kb/239114
but failed. I don't think there is a Jet 4.0 SP8 as such any longer.
It's all in the form of hotfixes. I have Windows XP SP3 to which I have
some time ago updated with Jet 4.0 SP8. I downloaded
WindowsXP-KB829558-x86-ENU.exe as that article says, set wine to Windows
XP and executed
wine WindowsXP-KB829558-x86-ENU.exe
It refused to run, saying my version of XP was already ahead of where it
was trying to update to.
"...the ODBC Desktop Driver Pack drivers. These drivers are included
with the Windows 2000 operating system, the Windows XP operating system,
and the Windows Server 2003 operating system."
This article
http://support.microsoft.com/kb/271908/
says
"MDAC version 2.6 and later do not contain Jet or Desktop ODBC drivers"
so it seems the latest MDAC's no use, so I use my list of files from my
WinXP installation. I may have missed something, but that's the way it
seems it has to be. Do you really want to go back to MDAC 2.5?
It may be that to fully support all features of JET databases and ODBC
there are some other DLLs (look at
http://msdn.microsoft.com/en-us/library/ms810823.aspx) which should also
be added. What I gave is a minimum set to get my programs to work.
We talk about winetricks here because Dan Kegel and Austin English put a
lot of time into it to make it work.
For Jet/Access database use, I retrieve the winetricks script, save it
as a file, make it executable (that may be because I'm using a Mac).
./winetricks jet40 mdac28
This retrieves the Jet Engine version 4.0 and MDAC 2.8.
I would have to check if MDAC includes the ODBC frontend, but it
probably does not. I don't think that it would be legal to copy the
ODBC front end from Windows, but then again a replacement program might
be available.
I am going to get you list and then use a clean wineprefix to see how
much of what you installed is installed with these two updates.
James McKenzie
James,
Contrary to what the article (271908 ) I quoted earlier says the latest
MDAC does contain the ODBC
files if you look in the manifest. The Jet SP contains the others apart
from these:
clbcatq.dll
comres.dll
So, I've done as you suggest and used winetricks on a clean .wine to
download & install Jet 4.0 and MDAC 2.8.
However I note that the Jet package is for old windows, not XP or 2k.
This does everything except set up the registry for the Jet drivers in
- HKLM\Software\ODBC
So I imported the reg file for that.
This works for my programs. The missing dlls don't seem to matter. It's
also a more comprehensive set of dlls.
For example I didn't have the odbc drivers for cursors, which I don't use.
In a separate mail I'll lay out my revised how-to!

Thanks very much,

Barry
liz lock
2018-06-14 11:00:59 UTC
Permalink
I just wanted to thank Barry Bird so, so much for this very old post. I
have struggled with this issue getting some massively complicated Word
macros that interact with Access databases to work under Wine (and
Crossover Linux) and his solution just ... worked. Brilliant!

(Mrs) Elizabeth Lock
Oxford

Continue reading on narkive:
Search results for 'ODBC Databases: Jet/Access success' (Questions and Answers)
3
replies
Database dreamweaver to Ms Access?
started 2009-04-24 02:59:49 UTC
programming & design
Loading...