使用PHP配置并连接access数据库

建立文件default.php;输入:

<?
  $conn = new com("ADODB.Connection"); 
  $connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("data/db.mdb"); 
  $conn->Open($connstr); 
  $rs = new com("ADODB.RecordSet"); 
  $rs->Open("select * from szd_t",$conn,1,1); 
  while(! $rs->eof) { 
  $f = $rs->Fields(1); 
  echo $f->value; 
  $rs->MoveNext(); 
  } 
  ?>

 

你可能感兴趣的:(PHP,Microsoft,F#,Access)