开发者

unable to connect to database on a networked drive

开发者 https://www.devze.com 2022-12-31 23:13 出处:网络
I\'m trying to connect to an access database from a php script using ODBC. When I put the db on my local c: drive create a system DSN i can connect no problem, but when it\'s on the networked drive

I'm trying to connect to an access database from a php script using ODBC.

When I put the db on my local c: drive create a system DSN i can connect no problem, but when it's on the networked drive I get the error:

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:\wamp\www\suppli开发者_如何学Cers\furniture.php on line 3

Ok so I'm guessing it's permissions somewhere anyone know specifically what/where?

Thanks,


If you used the defaults during installation then apache is running with the Local System account, which doesn't have any network privileges. So you have to make sure it runs as a (domain) user that can access the network drive. You can change this via Control Panel, Administrative Tools, Services (right click on Apache, select Properties and select a user on the Log On tab).


I had to retrieve data from a legacy database application made in MS Access 2003, so I created an ODBC DSN to do the trick. However, the Access database was in a network drive and kept getting the error described in this thread ('(unknown)' is not a valid path...) until I found out that I did not have to only choose the drive, directory and file name, from the Select Database dialog box, but also to write the entire path to the .mdb file as the database name file. Select the drive from the Drives dropdown list or use the 'Network...' button, then select the file name and finally, in the Database Name textbox prepend the path to your .mdb file as seen in the following image:

unable to connect to database on a networked drive

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号