If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

MS Access on Wine with ODBC

Running msaccess 97 in wine can be accomplished with seemingly 99% full functionality*.

I happened to have an old CDROM of MS Office 97.
I wanted to install access to see if it could be used as a gui interface to postgresql.
After many failed attempts to get the darn thing to work, I nearly gave up trying to install it, and on wine.

Running msaccess 97 in wine needs DCOM98.EXE which is downloadable
from a google search. (from M$).
This is mentioned in the above howto.
However, I added the /C switch which specifically asks for the install path.
wine DCOM98.EXE /C
Accept liscense OK
In path to install DCOM98.EXE choose:
c:/windows/system32
Accept ovewrite "Yes to ALL"

I installed DCOM98.EXE both before and again after installing MS Office 97
because I do not know which files office installs or whether it reverts
any of the dcom files. I don't know -- it worked!

If you need to install DCOM98.EXE, then you will see that access
will always start minimized until you do.

If you are very good or very lucky, you will not encounter the
following problem while running MS Access 97:

Code:

**************************************************
* The dynamic-link library Commdlg failed: error code '0x1003'.
* The printer driver for the selected printer may be incorrectly installed.
* ... bla, bla, bla, bla ... OK
**************************************************
Reason: The registry may not have the default cups printer in quite the right place.
(I found this tip from extensive google search, but cannot find it again)
Solution: Run regedit in wine and manually add some entries in the right place.
Namely, 'HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/Print/Environments'
Probably has the correct entries under 'Windows NT x86/Drivers/Version-3/xxx'
But maybe not under 'Windows 4.0/Drivers'
So the key xxx and values must be manually added under
'Windows 4.0/Drivers'
where xxx = default cups printer name (which incidentally, must be operable)
The name (xxx) above, may be determined by typing localhost:631 into the browser
address bar and clicking on the Printers tab.
Choose the name displayed directly to the left of (Default Printer).
If there is only 1 printer, use that name.
For example: xxx = HP_deskjet_3320
In case 'Windows 4.0/Drivers' does not have HP_deskjet_3320,
a new key named HP_deskjet_3320 should be added under Windows 4.0/Drivers
and at least these string names/values be added under
Windows 4.0/Drivers/HP_deskjet_3320:
: Configuration File - wineps16
: Data File - <datafile?>
: Datatype - RAW
: Driver - wineps16
Once doing that, msaccess 97 can design/run reports and edit/use VBA code.

If VBA code looks garbled, then change the font for modules to a
readable font under Tools-->Options-->Module

* One annoying non-function of wine msaccess 97 is in the use of
PASS-THRU-QUERY
Eg., you cannot set the recordsource for a form or report to anything
that is not pre-defined in access as a query.
Reportedly, this problem persists in access 2007 as well.
A kludge workaround is to use VBA to redefine the sql in
a pre-defined PASS-THRU-QUERY.
Using a PASS-THRU-QUERY in combination with VBA to rewrite the sql in it
is the only cool way to use msaccess forms/query_input_data to send the
query to an external database such as PostgreSQL in it's native tonge.
Very cool things are possible.

Q: Can ms access be run from wine and use ODBC to hook up to PostgreSQL (or MySQL) ?
A: Yes

How about PostgreSQL.
If PostgreSQL is not already installed:
yum groupinstall "PostgreSQL Database"
yum install pgadmin3

!!! DO NOT DO THIS if you already have a PostgreSQL database !!!
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvv
service postgresql initdb
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
!!! DO NOT DO THIS if you already have a PostgreSQL database !!!

su - postgres
cd data
cp pg_hba.conf{,.orig}

Use editor on pg_hba.conf to tweak it from:
(Don't do this if you know what you are doing)

Code:

# "local" is for Unix domain socket connections only
local all all ident sameuser
# IPv4 local connections:
host all all 127.0.0.1/32 ident sameuser
# IPv6 local connections:
host all all ::1/128 ident sameuser

Use editor on pg_hba.conf to tweak it to:
(Don't do this if you know what you are doing)

Code:

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

I am a dummy and setting the permissions to trust is much easier to
deal with as long as I am willing to admit to being a dummy and
I promise to only use PostgreSQL on the local machine.
Don't do this if you know what you are doing.

exit from 'su - postgres' with

Code:

exit

su -
service postgresql restart

Set up a unixODBC default datasource with a database named test
which will be made available to a 'user' named test:
(access will pick this when you 'Get External Data' and 'Link table'
and select files of type 'ODBC Databases')
Database must match Username for this to work -- I think.
(Note: On Fedora, unixODBC is installed along with the yum groupinstall "PostgreSQL Database" above.
Others may need to install it separately.
The configuration file odbc.ini is in the /etc directory on Fedora systems.
The odbc.ini file might be in the /etc/unixodbc directory on other systems.)