I have searched this forum, and the web, and I have not been able to find a solution to my issue. I may not have used the right search information to find the answer, but I found a lot of issues close to mine, but nothing has helped.
We are running Apache/2.2.4 (Win32) PHP/5.2.3.
I am trying to use the odbc_connect to connect to an MS Access database that is on another server. I have tried to use both a system DSN, as well as putting the connection information into php. For example...
$con=odbc_connect("mysystemdsn","","") or die("didn't work");
$con = odbc_connect("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" ."\\myotherserver\d$\mydb.mdb","","") or die("didn't work");
I have also tried mapping a network drive so I did...
$con = odbc_connect("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" ."z:\mydb.mdb","","") or die("didn't work");
When not using the system DSN, I get...
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:\antoxrpt\index.php on line 7
didn't work
When using the system DSN, I get...
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data., SQL state S1000 in SQLConnect in C:\antoxrpt\index.php on line 4
didn't work
The above errors were received when I was going through a web page. If I went to the machine and ran my file through batch PHP (i.e. c:\php\php.exe myfile.php), it would successfully connect to the database and give me the expected results.
I am assuming that it is a security issue, but I just can figure out what access is need for what user. I have seen articles about IUSR_servername user, but most of them say it is for IIS. I have tried it anyway without any success. I have tried both IUSR_ and IUSER_, since I have seen references to both.
One other thing, I copied the MS Access database to the local server and it worked fine that way too. The only issue is that the database is part of a vendor application and I need realtime access to it so I can't move it. I also can't install a web server on the other machine.
Any help would be greatly appreciated.
Thanks