Help - Connecting to Access Db on win webserver using PHP
Posted: Wed Oct 30, 2002 6:40 am
Newbie - need all the help I can get...
Can PHP connect to an Access Database on my webserver? I see some references to Access in the posts. If so, what do I need to setup?
Someone pointed me to a link which described how to setup a DSN
on the webserver, but it was only for MS SQL not Access
I need an working ODBC driver for Access on the webserver
This is what I tried.
1. I used ODBC in the control panel on the webserver to create a System DSN called TESTNEW.
2. I picked the Microsoft Access Database driver.
3. I selected the testnewdb.mdb as the database
4. It says OK and now there is a System DNS called TESTNEW
This is the code but nothing happens...shouldn't it tell me at least whether or not I have successfully connected?
How can I tell?
Access is very good at connecting to other databases using ODBC, but I have not found anything to connect to an Access database.
TIA-TOMG
Can PHP connect to an Access Database on my webserver? I see some references to Access in the posts. If so, what do I need to setup?
Someone pointed me to a link which described how to setup a DSN
on the webserver, but it was only for MS SQL not Access
I need an working ODBC driver for Access on the webserver
This is what I tried.
1. I used ODBC in the control panel on the webserver to create a System DSN called TESTNEW.
2. I picked the Microsoft Access Database driver.
3. I selected the testnewdb.mdb as the database
4. It says OK and now there is a System DNS called TESTNEW
This is the code but nothing happens...shouldn't it tell me at least whether or not I have successfully connected?
How can I tell?
Code: Select all
<?PHP
$usr = "root";
$pwd = "door";
$db = "TESTNEW";
$host = "localhost";
# connect to database
$cid = odbc_connect($host,$usr,$pwd);
if (!$cid) { echo("ERROR: " . odbc_error() . "\n"); }
else { echo("OK-DOKEY"; }
?>TIA-TOMG