php - FairCom c-tree ODBC 连接 - PHP

标签 php odbc faircom faircom-db-sql

我在 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/

相关文章:

javascript - 如何在成功的 AJAX 发布后更新值/刷新页面

javascript - 更改用 php/mysql 创建的表行宽度的最佳方法?

php - mysql 和 php - 根据用户登录从数据库中检索数据

php - 使用正则表达式验证类/方法名称

java - 在 Java 应用程序中使用安全数据库

c++ - 为什么我的代码在 Windows 7 上不会出现段错误?

c# - 应用程序通过 ODBC 访问 Sage Line 50 数据时出错