CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    37

    [ADO] How to retrieve TEXT fields from SQL

    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.

  2. #2
    Join Date
    May 1999
    Posts
    388

    Re: [ADO] How to retrieve TEXT fields from SQL

    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


  3. #3
    Join Date
    Apr 1999
    Posts
    37

    Re: [ADO] How to retrieve TEXT fields from SQL

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured