問(wèn)題描述
我們正在嘗試通過(guò) PHP 中的 ODBC 創(chuàng)建與 SQL 數(shù)據(jù)庫(kù)的連接.
we are trying to create a connection with our SQL database trough ODBC in PHP.
這是我們當(dāng)前的腳本:
驅(qū)動(dòng)程序在 Qlikview 中工作,該 Qlikview 也連接到此數(shù)據(jù)庫(kù).
The driver is working in Qlikview which also connects to this database.
驅(qū)動(dòng)確實(shí)被PHP發(fā)現(xiàn)了,但我們認(rèn)為它只是無(wú)法登錄.
The driver is actually being found by PHP, but we think it just can't login.
PHP 返回以下錯(cuò)誤:
PHP is returning the following error:
我們希望有人能幫助我們解決這個(gè)問(wèn)題.
We hope someone can help us out with this problem.
推薦答案
如果您已經(jīng)定義了 ODBC 并存儲(chǔ)了密碼,您只需使用
if you already have the ODBC defined and have a stored password, you can simply connect with
其中 DSN_NAME 是您的 ODBC 數(shù)據(jù)源的實(shí)際名稱,無(wú)論是 MySQL、SQL Server 還是 DB2.
where DSN_NAME is the actual name of your ODBC datasource, be it MySQL, SQL Server or DB2.
您可以通過(guò)以下方式測(cè)試您的連接:
You can test your connection with the following:
這篇關(guān)于PHP PDO ODBC 連接的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!