不能用 DB-Library(如 ISQL)或 ODBC 3.7 或更早版本將 ntext 數(shù)據(jù)或僅使用 Unicode 排序規(guī)則的 Unicode 數(shù)據(jù)發(fā)送到客戶端。
在PB開發(fā)過程中,由于數(shù)據(jù)庫中使用了 ntext字段,出現(xiàn)以下提示錯(cuò)誤,
PB報(bào)錯(cuò): 不能用 DB-Library(如 ISQL)或 ODBC 3.7 或更早版本將 ntext 數(shù)據(jù)或僅使用 Unicode 排序規(guī)則的 Unicode 數(shù)據(jù)發(fā)送到客戶端。
由于sql server中,ntext和nvarchar字段是用unicode編碼存儲(chǔ)內(nèi)容的,因此php通過mssql擴(kuò)展讀取帶ntext和nvarchar類型字段的時(shí)候會(huì)抱錯(cuò)。
如果 title 字段類型為 nvarchar,content 字段類型為 ntext ,那么下面的sql語句會(huì)報(bào)錯(cuò):
select title,content from article where 1
正確的寫法是:
select convert(varchar(255),title) as title, convert(text,content) as content from article where 1
或者不使用ntext字段
posted on 2010-06-06 23:19
Ke 閱讀(2522)
評(píng)論(0) 編輯 收藏 所屬分類:
powerBuilder