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
    Location
    Beaverton, OR
    Posts
    241

    Setting True/False Field

    When you set a text field in a DAO database, you do something like:

    COleVariant v;
    v.SetString("Hello", VT_BSTRT);
    m_rs.SetFieldValue(field, v);



    However, I want to be able to set a True/False field in my database. How do I go about doing this? Do I need to use COleVariant::ChangeType()? And if so, how do I go about doing it? Thanks in advance for any help.


  2. #2
    Join Date
    Apr 1999
    Location
    Beaverton, OR
    Posts
    241

    Re: Setting True/False Field

    Well, I figured it out.

    BOOL variable=TRUE; //or whatever

    m_rs.SetFieldValue(field,
    COleVariant((long)variable, VT_BOOL));



    I don't know if this is exactly the most efficient method, but it worked for me.


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