|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-06-25 06:49 UTC] roland at daydream dot co dot 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 08:00:02 2025 UTC |
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.)