This example builds a connection to open Access's database in ODBC (a demonstration with access when you install it). After the SQL statement has been executed, the Recordset object is returned. The example shows the first three fields:
$DBC = new COM ("ADODB. Connection ");
$dbc->provider = "MSDASQL";
$dbc->open ("Nwind");
$rs = $dbc->execute ("SELECT * FROM Products");
$i = 0;
while (! $rs->eof) {
$i + = 1;
$FLD 0 = $rs->fields (0);
$FLD 1 = $rs->fields (1);
$FLD 2 = $rs->fields (2);
Print "$fld 0->value $fld 1->value $fld 2->value
";
$rs->movenext ();
}
$rs->close ();
?>
http://www.bkjia.com/PHPjc/315869.html www.bkjia.com true http://www.bkjia.com/PHPjc/315869.html techarticle This example builds a connection to open Access's database in ODBC (a demonstration with access when you install it). After the SQL statement has been executed, the Recordset object is returned. The example shows the top three ...