Click to See Complete Forum and Search --> : Setting True/False Field


nordyj
May 20th, 1999, 02:59 PM
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.

nordyj
May 21st, 1999, 12:54 PM
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.