ODBC and MS Access

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
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

ODBC and MS Access

Post by Johnm »

Hi all,
Does anyone know how to solve this error?

Code: Select all

Warning: SQL error: , SQL state 00000 in SQLConnect in D:\Inetpub\wwwroot\mis\jm\index.php on line 4
Here is the code for connecting to the db.

Code: Select all

<?php
    putenv('TEMP=c:\\temp');
    $odbc_conn=odbc_connect('Driver={Microsoft Access Driver (*.mdb)};','PhoneMaster_local','admin','*****');
    if (! $odbc_conn)
    {
        echo "Failed to connect";
        echo odbc_errormsg();
    }

?>
Thanks,

John M
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

Odd - I don't see any sqlcode, and would think a sqlstate of 0 is good!
Is the *.mdb local to the machine and in same directory? ODBC DNS set up on machine?

This site is for ADO connections, but might be useful:

http://www.able-consulting.com/ADO_Conn.htm

as is this one:
http://www.connectionstrings.com/

Access is a little flakey when trying use anywhere other than very local to the application.

fv
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

I resolved this by using oledb.

Thanks,
John M
Post Reply