我在 Windows ODBC 中配置了用户 DSN:
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();
}
我总是收到此错误:
failure
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
想知道在 PHP 中连接到该数据库的正确方法是什么。谢谢!
最佳答案
解决了。
PHP 无法连接到用户 DSN,它需要是系统 DSN。
另外,Windows ODBC Manager 默认为 64 版本,需要启动 32 版本来配置系统 DSN。
希望这对某人有帮助。
关于php - FairCom c-tree ODBC 连接 - PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24338238/