note 54409 rejected from function.odbc-connect by betz

From: Date: Sun, 03 Jul 2005 15:49:09 +0000
Subject: note 54409 rejected from function.odbc-connect by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-91367@lists.php.net to get a copy of this message
Note Submitter: korb at cosi dot pl ---- I was trying to connect to remote (on LAN) m$ access (on win xp, machine C) from the Linux box (machine A), but it's not working. I moved php scripts onto another XP box (machine B). Scripts connect to access only when it's on the box, but I cannot connect to remote access db on C. I have created system dns for my db on C and I shared folder with db over network with full priveleges but following error occurs: (share is called testkorb, path to catalog on C is c:\tempkorb\db1.mdb 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:\Apache2\htdocs\test.php on line 18 and the test.php: <?php function importTransFromMs() { $dbdir = ""; $cfg_dsn = "DRIVER=Microsoft Access Driver (*.mdb); DBQ=\\\\192.168.0.3\\testkorb\\testkorb\\db1.mdb; UserCommitSync=Yes; Threads=3; SafeTransactions=0; PageTimeout=5; MaxScanRows=8; MaxBufferSize=2048; DriverId=281; DefaultDir=C:/ProgramFiles/CommonFiles/ODBC/DataSources"; $cfg_dsn_login = "admin"; $cfg_dsn_mdp = "qwerty"; $sql = "SELECT Part No as partno FROM Trans ORDER BY Date DESC"; $odbcCon = odbc_connect($cfg_dsn,$cfg_dsn_login,$cfg_dsn_mdp); $rs = odbc_exec($odbcCon,$sql); while (($data = odbc_fetch_array($rs))) { echo $data['partno'].'<br>'; } } importTransFromMs(); ?> please help

« previous php.notes (#91367) next »