Page 1 of 1

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

Posted: Tue Aug 06, 2002 5:35 pm
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?

Posted: Wed Aug 07, 2002 10:21 am
by BooBoo
*bump*

What about php?

Posted: Thu Aug 08, 2002 7:18 am
by Geschi
Try it again by renaming your file to phptest.PHP ;-)

Posted: Thu Aug 08, 2002 10:45 am
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

Ok, some more suggestions

Posted: Thu Aug 08, 2002 7:02 pm
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', '' );

Posted: Fri Aug 09, 2002 9:47 am
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.