PHP with Oledb

Can I use PHP with an Oledb connection?

As far as I know, the database connection provided by the PHP extension is all odbc.

+5
source share
3 answers

You can use Microsoft ActiveX Data Objects (ActiveX OLEDB level) in PHP-Win without third-party extensions 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(); 
+10
source

Check out the ADOdb library extension for PHP . I have never used it, but it seems to be compatible with OLEDB providers.

+1
source

......

.

PHP .

. .

0
source

All Articles