|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-12-21 13:52 UTC] steeven at kali dot com dot cn
I have setup PHP to work with ADO, but they would't 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.
Test with ADODB,Word, It seemed that windows report chinese as one char, but php think it one byte.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 05:00:02 2025 UTC |
I donwload 4.05dev from www.mm4.de, and run the following code: <?php //phpinfo(); $dbc = new COM("ADODB.Connection"); $dbc->Provider = "sqloledb"; $dbc->Open('DSN=starmate;Database=magway;UID=sa;PWD='); $q="select title from css"; .... .... ?> Here is the result: Warning: Error in php_char_to_OLECHAR() in d:\apache\htdocs\magway\phorum\test.php on line 4 Warning: Invalid ProgID: ???ַ?????Ч[invalid class string(by me)] in d:\apache\htdocs\magway\phorum\test.php on line 4 Fatal error: Call to undefined function: open() in d:\apache\htdocs\magway\phorum\test.php on line 6 Please tell me what you need to know for more.