COM problem with ADO
| From: | phpme | Date: | Thu, 21 Dec 2000 18:27:23 +0000 |
| Subject: | COM problem with ADO | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31455@lists.php.net to get a copy of this message | ||
Hi, all
I have setup PHP to work with ADO, but It's so hard to made them work:
$dbc = new COM("ADODB.Connection");
$dbc->Provider = "sqloledb";
$dbc->Open('DSN=starmate;Database=magway;UID=sa;PWD='); //OK
$q="select title from css";
//1. command object
$cm= new COM("ADODB.Command");
$cm->CommandText=$q;
$cm->ActiveConnection=$dbc; //PropPut() failed!!!
$rs=$cm->Execute(); //Invoke() failed!!!
//
//2. recordset still don't work
$rs=new COM("ADODB.Recordset");
$rs->Open($q); //Invoke() failed!!!
//only this code will work
$rs=$dbc->Execute($q);
echo $rs->fields[0]->value . "<br>";
On the other hand, all the Double byte char input/output will be cut to
1byte. 测试a will be changed to 3 byte char.
regards,
steeven