Hi,
I have tried lots of different ways but can't connect to a MS ACCESS database. All the example scripts assume the database has a password etc but what if it doesn't? I know how to connect to MySQL databases with PHP and it always connects, but don't know how to with ACCESS databases. Can someone provide some code to connect to an ACCESS database using ODBC?
Any help will be very much appresiated 






JeevesBond posted this at 21:05—11th January 2008.
He has: 3,465 posts
Joined: Jun 2002
Am assuming you're using PHP to connect? Think you can just use "" as the username/password are blank.
<?php$db_connection = odbc_connect("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=/path/to/database\", \"\", \"\", \"SQL_CUR_USE_ODBC\");
?>
If that doesn't work, try:
<?php$db_connection = odbc_connect("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=/path/to/database\", \"admin\", \"\", \"SQL_CUR_USE_ODBC\");
?>
'admin' is the default user (I believe). Hope this helps.
a Padded Cell our articles site!
drew22299 posted this at 19:56—17th January 2008.
He has: 107 posts
Joined: Mar 2006
Thanks, that worked!
carloncho posted this at 06:47—27th January 2008.
They have: 18 posts
Joined: Jan 2008
What Access file version use?