-
August 30th, 2012, 04:02 PM
#1
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.
-
August 30th, 2012, 06:12 PM
#2
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.
-
August 31st, 2012, 12:00 AM
#3
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|