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

    [ADO] Error on LongVarChar

    I wrote some code like below using Visual C++.

    <CODE>

    _RecordsetPtr rst
    FieldsPtr fields;
    FieldPtr field;

    fields = rst->GetFields();
    field = fields->GetItem(0);
    _bstr_t str = _bstr_t(field->Value); // <-- Error occur

    The field 0's type is adLongVarChar.
    And this is terminated by error occurrence.
    How to fit a _variant_t of adLongVarChar into a _bstr_t variable?

    I'll be happy to receive your answer.


    A programmer who loves Goethe.

  2. #2
    Join Date
    Apr 1999
    Posts
    27

    Re: [ADO] Error on LongVarChar

    Could it be that the value that youare returning is VT_NULL? I have found that it is always a good idea to check for vt!=VT_NULL prior to doing anything with character string


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