PHP with Oledb

房东的猫 提交于 2019-12-30 06:39:28

问题


Can I use PHP with Oledb connection?

As far as I know database connection as provided by PHP extension are all odbc.


回答1:


You can use ActiveX Data Objects (Microsoft's OLEDB ActiveX layer) in PHP-Win without any third party extension as such:

$conn = new COM("ADODB.Connection") or die("Cannot start ADO"); 

// Microsoft Access connection string.
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\inetpub\wwwroot\php\mydb.mdb");

// SQL statement to build recordset.
$rs = $conn->Execute("SELECT myfield FROM mytable");
echo "<p>Below is a list of values in the MYDB.MDB database, MYABLE table, MYFIELD field.</p>";

// Display all the values in the records set
while (!$rs->EOF) { 
    $fv = $rs->Fields("myfield");
    echo "Value: ".$fv->value."<br>\n";
    $rs->MoveNext();
} 
$rs->Close(); 



回答2:


Look at the ADOdb Library for PHP extension. I've never used it, but it seems to be compatible with OLEDB providers.




回答3:


maybe......

found an article on it.

found the PHP extension for it.

Don't know anything about it. Best of luck.



来源:https://stackoverflow.com/questions/1101338/php-with-oledb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!