CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1

    Not able to differentiate between empty column and null column

    We are experiencing a problem in finding out whether a column value is NULL or not NULL in VC++;
    We are trying out this in ADO programming. We are expecting your useful reply in this regard.


    vcpraveen

  2. #2
    Join Date
    Jun 1999
    Posts
    4

    Re: Not able to differentiate between empty column and null column

    I tend to use the CDaoRecordSet::GetFieldValue() method to grab the value of a field if I don't know whether the column is populated or not.


    COleVariant varValue;

    // Get field value.
    rs.GetFieldValue(_T("MY_COLUMN"), varValue);

    // Check if it is NULL or a real value...





  3. #3
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: Not able to differentiate between empty column and null column

    If you are using the #import ADO version then do the following.
    _variant_t var = rs->GetCollect(L"SomeField");

    if ( var.vt != VT_NULL )
    {
    // Assign the value
    }




    Wayne


  4. #4
    Guest

    Re: Not able to differentiate between empty column and null column

    If you are using DBF_ for field exchange, MFC substitutes a "psuedo" value for NULL columns. These are defined in afxdb_.h




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