Arkadaşlar aşağıdaki kodlar ile php ile access veritabanına bağlantı yapabilirsiniz.
// Connection
$conn = new COM("ADODB.Connection") or die("ADODB başlatılamıyor");
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=rehber.mdb");
// Recordset
$rs = $conn->Execute("SELECT * FROM adres");
// Alan isimlerini döküyoruz
echo "<TABLE border='1'><TR><TH colspan='6'>Veriler</TH><TR>";
echo "<TR>";
echo "<TH>" . $rs->Fields[0]->name . "</TH>";
echo "<TH>" . $rs->Fields[1]->name . "</TH>";
echo "<TH>" . $rs->Fields[2]->name . "</TH>";
echo "<TH>" . $rs->Fields[3]->name . "</TH>";
echo "<TH>" . $rs->Fields[4]->name . "</TH>";
echo "<TH>" . $rs->Fields[5]->name . "</TH>";
echo "</TR>";
// Verileri döküyoruz
while (!$rs->EOF)
{
echo "<tr>";
echo "<td>" . $rs->Fields[0]->value . " </td>";
echo "<td>" . $rs->Fields[1]->value . " </td>";
echo "<td>" . $rs->Fields[2]->value . " </td>";
echo "<td>" . $rs->Fields[3]->value . " </td>";
echo "<td>" . $rs->Fields[4]->value . " </td>";
echo "<td>" . $rs->Fields[5]->value . " </td>";
echo "</tr>";
$rs->MoveNext();
}
echo "</TABLE>";
// Kapanış
$rs->Close();
$conn->Close();
$rs->Release();
$conn->Release();
$rs = null;
$conn = null;