469,344 Members | 6,163 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

Issue accessing MS Access database on another server

9
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
Feb 15 '08 #1
1 3471
pbmods
5,821 Expert 4TB
Heya, VB Ace (VB/PHP Ace?).

I have recommended that a moderator move this thread to the Access forum. They may know what's going on here.
Jun 27 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Russell Read [MSFT] | last post: by
19 posts views Thread by Materialised | last post: by
3 posts views Thread by crombinator | last post: by
2 posts views Thread by le0 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.