PHP connects to the access database. This article describes how to use ADO in PHP to connect to the access database. it is very simple to use, we recommend that you connect to the access database using PHP for reference.
This article describes how to use ADO to connect to the ACCESS database in php. it is very simple to use and is recommended for reference by partners who need it.
Because the previous PingSwitch is used as a front-end for WEB display, the Delphi and access structures are used at the beginning, and the connection between Delphi and MySQL is relatively troublesome, at last, I can only choose a combination of PHP + Access, which is strange but reasonable ·····
To connect to the access database in PHP, we must connect to ADO, which is very similar to connecting to the database in ASP. A demo is provided below for your reference.
?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
/* 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 record set query */ $ Rs = @ new COM ("ADODB. RecordSet "); $ Rs-> Open ("select * from dbo_dirs", $ conn, 1, 3 ); /* Read data cyclically */ While (! $ Rs-> eof ){ Echo "$ rs-> Fields [" title "]-> Value; Echo" "; $ Rs-> Movenext (); // move the record set pointer down } $ Rs-> close (); ?> |
In this way, it will be okay ····
The above is all the content of this article. I hope you will like it.
This article describes how to use ADO in php to connect to the ACCESS database. it is very simple to use and is recommended for reference by partners who need it...