note 54409 added to function.odbc-connect
| From: | korb at cosi dot pl | Date: | Sun, 03 Jul 2005 14:46:52 +0000 |
| Subject: | note 54409 added to function.odbc-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91366@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.odbc-connect.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54409
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54409&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54409&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54409&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54409&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54409&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54409&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54409&report=yes
Search -- http://master.php.net/manage/user-notes.php