How does PHP connect to the Access database. D: Accessdb1.mdb user name: Admin Password: 123 How can I establish a connection with this file in PHP ------------------------------------------------------- The first method is to use ODBC D: Accessdb1.mdb
Username: Admin
Password: 123
How can I establish a connection with this file in PHP?
---------------------------------------------------------------
The first method is to use ODBC to create a system data source for db1.mdb in the ODBC controller.
Name: dbdsn (set by yourself)
Driver: Microsoft Access Driver (*. MDB)
Code:
...
$ Conn = odbc_connect ("dbdsn", "admin", "123"); // connect to the data source
$ Doquery = odbc_exec ($ Conn, "select * from table name where Condition"); // execute the query
...
The second method is ADO.
...
$ Conn = new COM ("ADODB. Connection ");
$ Dsn = "DRIVER = {Microsoft Access Driver (*. mdb)}; DBQ =". realpath ("path/db1.mdb ");
$ Conn-> open ($ dsn );
$ SQL = "select * from table name where condition ";
$ Ru = $ conn-> Execute ($ SQL );
Http://www.bkjia.com/PHPjc/630930.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/630930.htmlTechArticleD:Accessdb1.mdb username: Admin Password: 123 could you tell me how to establish a connection with this file in PHP --------------------------------------------------------- The first way is to use ODBC...