DrDamnit
asked on
ODBC Connection to Access database with PHP
I followed the steps here:
http://www.devasp.com/samples/dsn_access.asp
and created a DSN, which went OK.
Then I tried to use this code to access it, but it keeps failing. $conn is empty.
What am I doing wrong?
http://www.devasp.com/samples/dsn_access.asp
and created a DSN, which went OK.
Then I tried to use this code to access it, but it keeps failing. $conn is empty.
<?php
$conn=odbc_connect('MCDB','phpadmin','********!');
if (!$conn)
{
exit("Connection Failed: " . $conn);
}
else
{
echo "Connection Established";
}
odbc_close($conn);
?>
What am I doing wrong?
If so... Seems ok but double check:
DSN name ? Is it the same ?
Are you providing good password ?
DSN name ? Is it the same ?
Are you providing good password ?
ASKER
Since this is a Windows 2k8 box, there is no user and password because I have used a system DSN.
In that same vein, I have manually added some user / passwords to the DSN, and I have also tried authenticating with the system administrator credentials (with and without the DOMAIN\User format). All to no avail.
ODBC is already installed on a Windows SBS 2008 box, so I don't think I need to install anything else. I did, however have to install the access drives, but that went ok.
In that same vein, I have manually added some user / passwords to the DSN, and I have also tried authenticating with the system administrator credentials (with and without the DOMAIN\User format). All to no avail.
ODBC is already installed on a Windows SBS 2008 box, so I don't think I need to install anything else. I did, however have to install the access drives, but that went ok.
Does this work without providing ANYTHING ?
$conn=odbc_connect('MCDB', '','');
$conn=odbc_connect('MCDB',
ASKER
No joy.
I have set the file permissions to this as Everyone = Full Access (for the folder that contains this file). Still didn't work.
Thoughts?
I have set the file permissions to this as Everyone = Full Access (for the folder that contains this file). Still didn't work.
Thoughts?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Still fails. Just to beclear, dbq should be the DSN or the path to the file?
ASKER
The key was to do a DSN-less connection using the full path. Thanks!
Isn't that the thing suggested by the first post ?
http://www.actionscript.org/forums/showthread.php3?t=21969