Use the odbc_connect () function using the database source name (DSN). Alternatively, you can use the DSN-less connection string.
connections to DSN-less
If there is no password, leave the username as "sa" and the password is empty.
$conn = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdb_file", $user, $password);
DSN Connection
* http://www.w3schools.com/php/php_db_odbc.asp*
""
" (ODBC)" .
" DSN".
"" " DSN".
Microsoft Access Driver. "".
"", .
(DSN).
"".
$conn = odbc_connect($dsn_name, $user, $password);
Query:
$res = odbc_exec($conn, "select * from table");
:
while( $row = odbc_fetch_array($res) ) {
print_r($row);
}
: http://www.php.net/manual/en/ref.uodbc.php