2013-06-06 66 views
1

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

連接關閉。

有關這方面的任何建議嗎?

謝謝!

回答

1

要做的最好的事情是將操作的驅動程序日誌發送到[email protected],我們將看看發生了什麼事情。我會發布我們在這裏找到的任何內容。

獲取該日誌,添加到您的DSN在odbc.ini文件:

Logging = Yes 
LogFile = /tmp/drb.log 
+0

已經談過斯軟件支持。謝謝 – user2426961

+0

爲了完成這個工作,我們(Easysoft)發現它是一個由數據庫名長度大於18個字符而引起的驅動程序問題。現在修復。 –