MS access php not working

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
tegwin
Forum Newbie
Posts: 8
Joined: Fri Nov 27, 2009 5:19 am

MS access php not working

Post by tegwin »

I am trying to query data in an MS Acccess .MDB File.

I have followed the instructions here to the letter http://www.w3schools.com/PHP/php_db_odbc.asp

However that does not work. I get these errors:
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides., SQL state S1009 in SQLConnect in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\behaviour\lunchtime_detentions.php on line 4

Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\behaviour\lunchtime_detentions.php on line 6
S1009
Is there something else that needs to be configured within the server for this to work properly? I am running Windows 2K3, Apache 2.2, php 5.2.6

My phpinfo shows this:
odbc
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library Win32

Directive Local Value Master Value
odbc.allow_persistent On On
odbc.check_persistent On On
odbc.default_db no value no value
odbc.default_pw no value no value
odbc.default_user no value no value
odbc.defaultbinmode return as is return as is
odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes
odbc.max_links Unlimited Unlimited
odbc.max_persistent Unlimited Unlimited
Anyone have any ideas? I am really struggling to figure this out!
mikosiko
Forum Regular
Posts: 757
Joined: Wed Jan 13, 2010 7:22 pm

Re: MS access php not working

Post by mikosiko »

post the code where you define the odbc connection, your Sql sentence and your odbc_exec line

Miko
Post Reply