One is the use of PHP PDO, a odbc,com interface to connect to an Access database.
Using PDO to connect to an Access database
Copy CodeThe code is as follows:
$path = "F:fontwww.jb51.netspiderresult.mdb";
$conn = new PDO ("SQLite: $path");
if ($conn)
{
Echo (' Connection PDO success ');
}
Else
{
Echo (' Cnnection PDO fail, plase check Database server! ');
}
Connecting Databases with Odbc_connect
Copy CodeThe code is as follows:
$conn = Odbc_connect ("Dbdsn", "admin", "123"); Connecting to a data source
$doquery =odbc_exec ($conn, "select * from table name where Condition");//Execute Query
Connect to an Access database by using COM interfaces
$conn =new com ("adodb.connection");
$DSN = "Driver={microsoft Access Driver (*.mdb)};d bq=". Realpath ("Path/db1.mdb");
$conn->open ($DSN);
http://www.bkjia.com/PHPjc/825153.html www.bkjia.com true http://www.bkjia.com/PHPjc/825153.html techarticle One is the use of PHP PDO, a odbc,com interface to connect to an Access database. Use PDO to connect to the Access database to copy the code code as follows: $path = "F:fontwww.jb51.netspiderresult ...