D:accessdb1.mdb
User name: Admin
Password: 123
How can I establish a connection with this file in PHP
---------------------------------------------------------------
The first approach is to use ODBC to build a system data source for Db1.mdb in the ODBC governance
Name: DBDSN (can be determined by oneself)
Driver: Microsoft Access Driver (*. MDB)
Code:
...
$Conn = Odbc_connect ("Dbdsn", "admin", "123"); Connecting to a data source
$Doquery =odbc_exec ($Conn, "select * from table name where Condition");//Execute Query
...
The second way is ADO
...
$conn =new COM ("ADODB. Connection ");
$DSN = "Driver={microsoft Access DRIVER (*.mdb)};D bq=". Realpath ("Path/db1.mdb");
$conn->open ($DSN);
$sql = "SELECT * from table name where condition";
$ru = $conn->execute ($sql);
http://www.bkjia.com/PHPjc/630930.html www.bkjia.com true http://www.bkjia.com/PHPjc/630930.html techarticle d:accessdb1.mdb Username: Admin Password: 123 How can I establish a connection with this file in PHP------------------------------------------------------------ ---The first way is to use ODBC ...