There were definitely two nasty bugs in the COM code which I believe that I have fixed and checked into CVS. But the root cause of your problem is actually a COM exception thrown by ADODB.Connection. I see this exception when I pass "position" (a valid field name in the database) in a SQL queries through the execute method. And most strangely the component does not seem to populate the IErrorInfo in this case, which is why your:
if ($DB->Errors->Count > 0) { print $DB->Errors[0]->description; } code resulted in a php_OLECHAR_tochar() error - the underlying object placed a NULL in the VARIANT of type VT_BSTR. e.g. <?php $DB = new COM("ADODB.Connection"); $DB->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=i:\\tmp\\test.mdb"); $DB->execute("SELECT position FROM foobar"); # I guess position is a reserved SQL word if ($DB->Errors->Count > 0) { print $DB->Errors[0]->description . "<BR>"; } ?> I suppose that we see this problem when "reservered words" are not escaped. In general though, an error in the component does result in a sane message: When I "quote" position int he query string thus: $DB->execute("SELECT 'position' FROM foobar"); I do see a valid message: Warning: Invoke() failed: Exception occurred. Source: Microsoft JET Database Engine Description: The Microsoft Jet database engine cannot find the input table or query 'foobar'. Make sure it exists and that its name is spelled correctly. in I:\httpd\html\tests\test.php on line 11 The Microsoft Jet database engine cannot find the input table or query 'foobar'. Make sure it exists and that its name is spelled correctly. I honsetly do not know what is wrong with: SELECT IDCode, Report_Name, Report_Description, Report_Stat FROM Reports it certainl;y works fine for me - so perhaps the example you sent was indeed not the actual string which produced the error for you? There is a PHP function to escape SQL strings somewhere- not sure if it is smart enough to quote reserved words that are not already quoted...... Alan. -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php