Use odbc_connect() function using a database source name (DSN). Alternatively, a DSN-less connection string can be used.
DSN-less connections
if no password, leave username as "sa" and password blank.
$conn = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdb_file", $user, $password);
To Connect with DSN
from *http://www.w3schools.com/php/php_db_odbc.asp*
Open the Administrative Tools icon in your Control Panel
Double-click on the Data Sources (ODBC) icon inside.
Choose the System DSN tab.
Click on Add in the System DSN tab.
Select the Microsoft Access Driver. Click Finish.
In the next screen, click Select to locate the database.
Give the database a Data Source Name (DSN).
Click OK.
$conn = odbc_connect($dsn_name, $user, $password);
Query:
$res = odbc_exec($conn, "select * from table");
List results:
while( $row = odbc_fetch_array($res) ) {
print_r($row);
}
More info: http://www.php.net/manual/en/ref.uodbc.php