PHP with Oledb
Asked Answered
P

3

7

Can I use PHP with Oledb connection?

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

Postremogeniture answered 9/7, 2009 at 1:6 Comment(0)
C
11

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(); 
Crofter answered 27/7, 2009 at 2:13 Comment(0)
A
1

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

Asymptotic answered 9/7, 2009 at 5:25 Comment(0)
S
-1

maybe......

found an article on it.

found the PHP extension for it.

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

Spavin answered 9/7, 2009 at 3:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.