【发布时间】: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 中给出
连接已关闭。
对此有何建议?
谢谢!
【问题讨论】: