php connect access database

WBOY
Release: 2016-07-25 09:09:04
Original
1020 people have browsed it
  1. $conn = new com("ADODB.Connection");
  2. $connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= ". realpath("data/db.mdb");
  3. $conn->Open($connstr);
  4. $rs = new com("ADODB.RecordSet");
  5. $rs->Open("select * from szd_t",$conn,1,1);
  6. while(! $rs->eof)
  7. $f = $rs->Fields(1);
  8. echo $f->value;
  9. $rs ->MoveNext();
  10. ?>
Copy code


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template