Bug #11655 Updated: Ivoking COM will not work.
| From: | roland at daydream dot co dot uk | Date: | Wed, 27 Jun 2001 12:50:19 +0000 |
| Subject: | Bug #11655 Updated: Ivoking COM will not work. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-58195@lists.php.net to get a copy of this message | ||
ID: 11655
User Update by: roland@daydream.co.uk
Old-Status: Open
Status: Closed
Bug Type: COM related
Operating system: Win NT4.0 SP6a
PHP Version: 4.0.6
Description: Ivoking COM will not work.
Thank you, you are completely right. I had a closer look at this and found the following problem
with the connection string:
To achieve a dsn-less connection, I used a valid System-DSN pointing to an empty .mdb file. The
DBQ-Attribute pointed to the actual database. This does not work under PHP, it has to be the same
datasource as in the DSN (e.g. in ColdFusion this is the only way of creating a dsn-less
connection).
To get a dsn-less connection with PHP is actually even simpler, done with this connection string:
$myDSN = "DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=c:\\test.mdb;User='root';Password='';";
(note that in my post above is a space missing, instead of
Microsoft Access Driver(*.mdb), it should read
Microsoft Access Driver (*.mdb)
-----------------------^
, which will prevent it from working correctly, too.)
Previous Comments:
---------------------------------------------------------------------------
[2001-06-27 07:12:48] phanto@php.net
i can't reproduce this. are you sure that your mdb is in the right place ? i get this kind of
error if the DSN is invalid.
harald
---------------------------------------------------------------------------
[2001-06-26 10:29:12] roland@daydream.co.uk
The exception occurs in line 5, which is
$dbc->Open($myDSN);
---------------------------------------------------------------------------
[2001-06-26 10:20:46] phanto@php.net
in which line does the warning occur ?
---------------------------------------------------------------------------
[2001-06-25 06:49:59] roland@daydream.co.uk
This does not work, but worked unchanged in PHP 4.0.4pl1
$myDSN = "DSN=dbEmpty;DBQ='c:\test.mdb';DRIVER={Microsoft Access
Driver(*.mdb)};UID='root';PW='';";
$dbc = new COM("ADODB.Connection");
$dbc->Provider = "MSDASQL";
$dbc->Open($myDSN);
Warning: Invoke() failed: Exception occurred (line $dbc->Open($myDSN); )
Setting from php.ini:
;com.typelib_file =
com.allow_dcom = On
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=11655