【发布时间】:2009-08-06 02:39:38
【问题描述】:
我有表 Tbl1( SomeName nvarchar(64) )
在 OLEDB 上,我正在尝试选择
SELECT 1 FROM Tbl1 WHERE SomeName = ?
binding 3 character unicode as parameter 导致:DB_E_ERRORSINCOMMAND(0x80040E14L) "The data types nvarchar and ntext are in compatible in the equal to operator"
我已经尝试过以下输入绑定:
1) ...
currentBind.wType = DBTYPE_VARIANT;
currentBind.cbMaxLen = 20
// where data points to valid VT_BSTR allocated by SysAllocString
...
2) ...
currentBind.wType = DBTYPE_WSTR;
currentBind.cbMaxLen = 20
// where data points to valid VT_BSTR allocated by SysAllocString
...
SQLServer 无论如何都会将此参数视为 ntext。 有什么建议么?提前谢谢你。
【问题讨论】:
标签: sql-server oledb nvarchar ntext