ms access bug
Brought to you by:
skuchin
when I use the otl with ms access.
std::string strSelCmd = "select * from UsersTbl where strLoginName='admin'";
otl_stream stream( 10 , strSelCmd.c_str() , m_db );
the admin's strLoginPass field is null.
then I use
std::string strSelCmd = "select * from UsersTbl";
otl_stream stream( 10 , strSelCmd.c_str() , m_db );
the admin's record's strLoginPass field is not null.
it is the prev record's the same filed's value.
From the F.A.Q.:
/Q. OTL: how does OTL handle NULLs?/
Call otl_stream::is_null
http://otl.sourceforge.net/otl3_stream_class.htm#is_null() to
check whether the value that was just read from the stream is NULL
or not.
Use template class otl_value
http://otl.sourceforge.net/otl3_value.htm<t>.</t>
If there is a need to set the output variable to a value when NULL
is fetched (by default, OTL does not set the output buffer to any
value in the case of NULL), the following #defines could be enabled:
o OTL_DEFAULT_NUMERIC_NULL_TO_VAL
http://otl.sourceforge.net/otl3_compile.htm#OTL_DEFAULT_NUMERIC_NULL_TO_VAL
o OTL_DEFAULT_DATETIME_NULL_TO_VAL
http://otl.sourceforge.net/otl3_compile.htm#OTL_DEFAULT_DATETIME_NULL_TO_VAL
o OTL_DEFAULT_STRING_NULL_TO_VAL
http://otl.sourceforge.net/otl3_compile.htm#OTL_DEFAULT_STRING_NULL_TO_VAL
o OTL_DEFAULT_CHAR_NULL_TO_VAL
http://otl.sourceforge.net/otl3_compile.htm#OTL_DEFAULT_CHAR_NULL_TO_VAL
o OTL_USER_DEFINED_STRING_CLASS_DEFAULT_NULL_TO_VAL
http://otl.sourceforge.net/otl3_compile.htm#OTL_USER_DEFINED_STRING_CLASS_DEFAULT_NULL_TO_VAL
saka2god wrote: