我在Windows 7中安裝了easysoft odbc derby驅動程序,並嘗試在ODBC數據源管理員DSN上配置並連接成功後連接到derby數據庫 。適用於PHP的ODBC DERBY驅動程序
然後我試圖在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.";
後,我運行此腳本,這條消息出現
已連接到數據源
Warning: odbc_exec(): SQL error: [Easysoft][ODBC-Derby Driver][DRDA]General error: unexpected command (dss not returned), SQL state HY000 in SQLExecDirect in C:\xampp\htdocs\test\index.php on line 36 Error while executing command
Warning: odbc_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\test\index.php on line 45
連接關閉。
有關這方面的任何建議嗎?
謝謝!
已經談過斯軟件支持。謝謝 – user2426961
爲了完成這個工作,我們(Easysoft)發現它是一個由數據庫名長度大於18個字符而引起的驅動程序問題。現在修復。 –