Click to See Complete Forum and Search --> : CDBVariant Help


Mitch Wittneben
April 8th, 1999, 07:16 AM
Here is an interesting one. I have the following code:

CDBVariant test;
m_Recordset->GetFieldValue(m_nFieldCount,test);
switch(test.m_dwType){
/*Many case statements follow*/
case DBVT_BOOL:
if (test.m_boolVal)
MessageBox("True")
else
MessageBox("False")
break;
}

Here is the puzzle. I always get "True". I did some digging and found that
m_boolVal=19409409 when TRUE and 19409408 when FALSE. Also, even though
m_dwType=1, the m_chVal member variable is storing either a 0 or 1 as I would have expected m_boolVal to do. I am mapping this to a SQL Server 7.0 bit field.The question is why. Or am I missing something.

thanks,
mitch