這個範例建了一個連接,用ODBC打開Access的資料庫NorthWind(安裝Access時帶的示範)。執行了SQL語句後,傳回了RecordSet物件。範例顯示了前三個欄位:
$dbc = new COM("ADODB.Connection");
$dbc->Provider = "MSDASQL";
$dbc->Provider = "MSDASQL";
$dbc- ("nwind");
$rs = $dbc->Execute("select * from products");
$i = 0;
while (!$rs->EOF) {
$i += 1;
$fld0 = $rs->Fields(0);
$fld1 = $rs->Fields(1);
$fld2 = $rs->Fields(1);
$fld2 = $rs->Fields(2) ;
print "$fld0->value $fld1->value $fld2->value
";
$rs->MoveNext();
}
$rs->Close( );
?>以上就介紹了windows vista home basic 在Windows版的PHP中使用ADO,包含了windows vista home basic方面的內容,希望對PHP教學有興趣的朋友有所幫助。