【问题标题】:ODBC DERBY DRIVER for PHP用于 PHP 的 ODBC DERBY 驱动程序
【发布时间】:2013-06-06 16:26:38
【问题描述】:

我在 windows 7 中安装了 easysoft odbc derby 驱动程序并尝试连接到 derby 数据库 在我在 ODBC 数据源管理器 DSN 上配置并连接成功后。

然后我尝试了 php 脚本

 //commz is the DSN name ind ODBC data source admin 
$connection = odbc_connect("commz",$user, $password);

if ($result = odbc_exec($connection, "SELECT * FROM ADDRESSBOOK"))
    print "Command executed successfully<BR><BR>";
else
    print "Error while executing command<BR><BR>";

  // Print results
  while(odbc_fetch_row($result))
    print odbc_result($result, 1) . "   " . odbc_result($result, 2) . "   " . odbc_result($result, 3) . "   " . odbc_result($result, 4) . "   " . odbc_result($result, 5) . "<BR>";

  odbc_close($connection);
  print "<BR>Connection closed.";

在我运行这个脚本之后,这个消息就会出现

连接到数据源

警告:odbc_exec():SQL 错误:[Easysoft][ODBC-Derby 驱动程序][DRDA]一般错误:意外命令(未返回 dss),SQL 在线 C:\xampp\htdocs\test\index.php 中的 SQLExecDirect 中声明 HY000 36 执行命令时出错

警告:odbc_fetch_row() 期望参数 1 是资源,布尔值 在第 45 行的 C:\xampp\htdocs\test\index.php 中给出

连接已关闭。

对此有何建议?

谢谢!

【问题讨论】:

    标签: php odbc derby


    【解决方案1】:

    最好的办法是将操作的驱动程序日志发送到 support@easysoft.com,我们将看看发生了什么。我会将我们找到的任何内容发回这里。

    要获取日志,请在 odbc.ini 文件中添加到您的 DSN:

    Logging = Yes
    LogFile = /tmp/drb.log
    

    【讨论】:

    • 为了解决这个问题,我们 (Easysoft) 发现这是由于数据库名称超过 18 个字符而导致的驱动程序问题。现已修复。
    猜你喜欢
    • 2016-03-16
    • 1970-01-01
    • 2018-06-19
    • 2021-09-28
    • 1970-01-01
    • 2018-02-27
    • 1970-01-01
    • 2017-01-17
    • 1970-01-01
    相关资源
    最近更新 更多