不能用 DB-Library(如 ISQL)或 ODBC 3.7 或更早版本將 ntext 數據或僅使用 Unicode 排序規則的 Unicode 數據發送到客戶端。
在PB開發過程中,由于數據庫中使用了 ntext字段,出現以下提示錯誤,
PB報錯: 不能用 DB-Library(如 ISQL)或 ODBC 3.7 或更早版本將 ntext 數據或僅使用 Unicode 排序規則的 Unicode 數據發送到客戶端。
由于sql server中,ntext和nvarchar字段是用unicode編碼存儲內容的,因此php通過mssql擴展讀取帶ntext和nvarchar類型字段的時候會抱錯。
如果 title 字段類型為 nvarchar,content 字段類型為 ntext ,那么下面的sql語句會報錯:
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)
評論(0) 編輯 收藏 所屬分類:
powerBuilder