Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UnixODBC, mdbtools and a MDB on windows

Status
Not open for further replies.

NVSbe

Programmer
Sep 9, 2002
153
0
0
BE
Hi. I'm trying to have PHP under Redhat 9.0 to connect to an access datafile on a windows 98 machine. For this, I'm using UnixODBC with the mdbtools odbc driver for Access.

This is my odbc.ini
Code:
[test]
Description = Microsoft Access Database
Driver = MDBToolsODBC
Database = /home/nvs/test.mdb
Servername = 127.0.0.1
UserName =
Password =
port = 5432
[test2]
Description = Microsoft Access Database
Driver = MDBToolsODBC
Database =D:\shared\share\test.mdb
Servername = (ip of win machine)
UserName =
Password =
port = 5432

The first one, [test], connects to an mdb file stored on the linux server itself. This is no problem, it works fine. The second one however produces this error in my php code:

Code:
Warning: SQL error: UODB4²ó@¸Îÿ¿›Êñ@€, SQL state 00000 in SQLConnect in /var/[URL unfurl="true"]www/html/mdb.php[/URL] on line 3

Now, I had the same error on the first one, which was easily solved by adding write permissions to the directory it was in. However, on Windows, the file is already on a share with full write permissions for everyone. I'm kind of stumped on this one. Anyone had this problem before?

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
Sollution!

This requires Samba installed.
Make a mountpoint for your windows share
Code:
mkdir -p /mnt/windows

Next, mount the share
Code:
mount -t smbfs //server/share /mnt/windows

In your odbc.ini, you can now state
Code:
[test2]
Description = Microsoft Access Database
Driver = MDBToolsODBC
Database = /mnt/windows/test.mdb
Servername = localhost
UserName =
Password =
port = 5432

Boy, that took some time to figure out.

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top