RFX_Double returns garbage value when parsing NULL from a table.
If I call RFX_Double(pFX, _T("Amount"), m_Amount) in MFC, the value under the column "Amount" is NULL, then m_Amount is set to garbage. How can I set m_Amount to 0 in this case? Thanks.
Re: RFX_Double returns garbage value when parsing NULL from a table.
Originally Posted by LarryChen
If I call RFX_Double(pFX, _T("Amount"), m_Amount) in MFC, the value under the column "Amount" is NULL, then m_Amount is set to garbage. How can I set m_Amount to 0 in this case? Thanks.
Look in MSDN under the CRecordset functions. You'll find what you're looking for, and you'd find it faster than asking here.
Re: RFX_Double returns garbage value when parsing NULL from a table.
In a database, NULL value means "unspecified/unknown/not set".
Not 0 (zero) or another particular value, so it's nothing wrong if a RFX function gives you garbage.
To solve your problem, the best solution is to re-design the table and add NOT NULL constraint and/or set default value 0 for that field.
Bookmarks