Unable to connect to a MS Access db - odbc_connect not work

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
BooBoo
Forum Newbie
Posts: 4
Joined: Tue Aug 06, 2002 5:35 pm

Unable to connect to a MS Access db - odbc_connect not work

Post by BooBoo »

When I try to connect to a MS Access database, I get this error:

Fatal error: Call to undefined function: odbc_connect() in /home/sites/home/web/phptest.htm on line 37

What have I done wrong?

I am using a Cobalt RaQ4i server, Red Hat Linux, MySQL, SegueLink, and MS Access 97. The code that I am using is:

$cnx = odbc_connect( 'SLSocket' , '', '' );

Did I miss anything?
BooBoo
Forum Newbie
Posts: 4
Joined: Tue Aug 06, 2002 5:35 pm

Post by BooBoo »

*bump*
Geschi
Forum Newbie
Posts: 21
Joined: Wed Jul 10, 2002 3:21 am
Location: Germany

What about php?

Post by Geschi »

Try it again by renaming your file to phptest.PHP ;-)
BooBoo
Forum Newbie
Posts: 4
Joined: Tue Aug 06, 2002 5:35 pm

Post by BooBoo »

Same error as with .htm. The extension should not matter as I can access a MySQL database using an .htm extension. Thanks for the suggestion and keep them coming! :D
Geschi
Forum Newbie
Posts: 21
Joined: Wed Jul 10, 2002 3:21 am
Location: Germany

Ok, some more suggestions

Post by Geschi »

Though your system configuration seems kind of odd to me in the first place, here are some more ideas (if it's a typical Microsoft thing, the 3rd will work):
1. Did you link the odbc-drivers correctly?
2. Did you set your php-interpreter to this path?
3. Is "$cnx = odbc_connect( 'SLSocket' , '', '' );" really the code you used?
Access normally wants an identified user. If you haven't set up a user, "Administrator" is the standard one. Therefore try using:
$cnx = odbc_connect( 'SLSocket' , 'Administrator', '' );
BooBoo
Forum Newbie
Posts: 4
Joined: Tue Aug 06, 2002 5:35 pm

Post by BooBoo »

Here is the latest. It is definitely a problem with the version of php that I am using. I created an ASP page and connected to the database with no problems. I think that I need to recompile php with a php_odbc rpm and with the addition of --with-odbc on the ./configure line.

The reason that I have to use MS Access, is that the database that I need to connect to, is a proprietary db, without an odbc driver. However, I can use MS Access to link to the db and get the data. The performance is not too bad.
Post Reply