One is to use php's pdo, and the other is to use odbc and com interfaces to connect to the access database.
Use pdo to connect to the access database
Copy the code The 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!');
}
Use odbc_connect to connect to the database
Copy code The code is as follows:
$conn = odbc_connect("dbdsn","admin","123"); //Connect to data source
$doquery=odbc_exec($conn,"select * from table name where condition");//Execute query
Use the com interface to connect to the access database
$conn=new com("adodb.connection");
$dsn="driver={microsoft access driver (*.mdb)} ;dbq=".realpath("path/db1.mdb");
$conn->open($dsn);
http://www.bkjia.com/PHPjc/825153.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825153.htmlTechArticleOne is to use php's pdo, and the other is odbc, com interface to connect to the access database. Use pdo to connect to the access database. Copy the code. The code is as follows: $path ="f:fontwww.jb51.netspiderresult...