Error in sql command when using ado in VC++ and unicode
-
my database on sql server 2005, and i was convert my project VC++ to unicode, the problem is : when i try to read a field value string from recordset the data is "??????" the code is:
_variant_t vFieldName (strFieldName);
_variant_t ret = m_rs->GetFields ()->GetItem (vFieldName)->GetValue();
CString str = (wchar_t *)(_bstr_t)vVal;:mad: when the language string is english ok but when it in other language the string is "???????"
-
my database on sql server 2005, and i was convert my project VC++ to unicode, the problem is : when i try to read a field value string from recordset the data is "??????" the code is:
_variant_t vFieldName (strFieldName);
_variant_t ret = m_rs->GetFields ()->GetItem (vFieldName)->GetValue();
CString str = (wchar_t *)(_bstr_t)vVal;:mad: when the language string is english ok but when it in other language the string is "???????"
This implies that your fields in the database are varchar and not nvarchar.
Never underestimate the power of human stupidity RAH
-
This implies that your fields in the database are varchar and not nvarchar.
Never underestimate the power of human stupidity RAH
thanks when i convert the field type from varchar to nvarchar the problem fixed.
-
thanks when i convert the field type from varchar to nvarchar the problem fixed.
Keep in mind that it also doubles the size (in bytes) of the field! :)
Luc Pattyn [My Articles] Nil Volentibus Arduum