PHP Connect to Access database, phpaccess database
Because the previous pingswitch to do a Web presentation of the front end, because the first use of Delphi and access structure, and the connection between Delphi and MySQL is relatively troublesome, and finally can only choose the combination of php+access, more strange, but also reasonable
To connect to an Access database in PHP, we have to connect with ADO, which is very similar to the connection database in ASP. Below gives a demo for everyone to refer to.
<? php/* Create an ADO connection */$conn = @new COM ("ADODB. Connection ") or Die (" ADO Connection faild. "); $connstr = "Driver={microsoft Access DRIVER (*.mdb)}; Dbq= ". Realpath ("Datum/cnbt.mdb"); $conn->open ($CONNSTR);/* Create Recordset Query */$rs = @new COM ("ADODB. RecordSet "), $rs->open (" SELECT * from Dbo_dirs ", $conn, 1, 3);/* loop to read data */while (! $rs->eof) {echo" $rs->fields[" Title "]->value; echo "
"; $rs->movenext (); Move the recordset pointer down} $rs->close ();? >
It's no problem running like this.
The above mentioned is the whole content of this article, I hope you can like.
http://www.bkjia.com/PHPjc/974657.html www.bkjia.com true http://www.bkjia.com/PHPjc/974657.html techarticle PHP connection to access database, phpaccess database because the previous pingswitch to do a Web presentation of the front end, because the first use of Delphi and Access structure, and Delphi and MySQL connection ...