I have a User DSN configured in Windows ODBC:
Name Driver
testdb FairCom c-tree ODBC Driver
$user = "";
$pass = "";
$dsn = "testdb";
$cx = odbc_connect($dsn,$user,$pass);
if($cx === false) {
echo "<br/>failure<br/><br/>";
echo odbc_errormsg();
}
I always get this error:
failure
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Wondering what's the correct way to connect to that database in PHP. Thanks!
Worked it out.
PHP can't connect to a User DSN, it needs to be System DSN.
Also, Windows ODBC Manager by default is 64 version, needs to launch 32 version to configure the System DSN.
Hope this helps someone.