Click to See Complete Forum and Search --> : [ADO] How to retrieve TEXT fields from SQL


reverse
April 9th, 1999, 07:28 AM
In ADO, TEXT fileds are converted into adLongVarChar.
In Visual C++, How to use this?
I tried to use GetValue() and cast into _bstr_t, but error occurred.
Invoking GetChunk(1000) and casting into _bstr_t is also failed.
I'm embarrassed.
What I have to do?

I'll appreciate your answer.


A programmer who loves Goethe.

Shahzad
April 9th, 1999, 08:46 AM
If you need to filtr data on text based criteria then do this:

m_strFilter = "[your_table_name].[text_variable] Like "+ CString("'")+m_sName +
CString("'");

then open the recordset. You will get the data filtered.
Remember the backets will remain in your code.

good luck
Shahzad

reverse
April 9th, 1999, 08:26 PM
I'm sorry I don't understand the answer.
I meant that I tried to retrieve a field which its Type property is "adLongVarChar" then, to convert into BSTR. The error was occurred at this casting time.
"Visual C++ Run Time Error"

I don't understand why to use filter.

Regards

A programmer who loves Goethe.