php - PDO connect to .accdb on network -
i have access database crud pdo. when database stored on c:\\wamp\\www\\test.accdb can connect. however, database interested in stored on our office server, @ \\server1\abc\123\test.accdb . \server1 mapped drive z:\ on computer.
my code looks (verbatim)
<?php //attempt 1 $file = "\\server1\\abc\\123\\test.accdb"; $dbh = new pdo("odbc:driver={microsoft access driver (*.mdb , *.accdb)};dbq=$file"); //attempt 2 $file = "z:\\abc\123\\test.accdb"; $dbh = new pdo("odbc:driver={microsoft access driver (*.mdb , *.accdb)};dbq=$file"); ?> both of these give me error:
sqlstate[hy024] sqldriverconnect: -1023 [microsoft][odbc microsoft access driver] '(unknown)' not valid path. make sure path name spelled correctly , connected server on file resides.
i indeed connected server. here have wisdom share?
as diagnostic check, try using same mechanism you've been using invoke pdo script invoke following script:
<?php $file = "\\\\server1\\abc\\123\\test.accdb"; if (is_file($file)) { echo "file exists.\r\n"; } else { echo "file not exist.\r\n"; } that test whether account under script running allowed access network , "see" file on remote server. if fails, check windows rights account.
as further test, try running same script windows command line using regular user account (which presumably does have sufficient rights access network).
Comments
Post a Comment