Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NULL INT field gives strange value in CRecordset class.

322 views
Skip to first unread message

Matthew Stanfield

unread,
May 9, 2001, 10:35:57 AM5/9/01
to
Hi,

My software uses a MFC CRecordset derived class.

Occasionally when I am doing a query 2 integer fields have strange
values. It seems that in the Database Table they are NULL. I'm accessing
them as a long in my MFC code, they are integers in the actual table.

The values are both '1246576928' (they should be 5 digits) - I had
assumed that NULL values in the database table would translate as 0 in
the member of the CRecordset class.

How do I tell in my MFC class when I'm getting a NULL value? It would be
hard to replace all NULL values in the table with 0 as there are many
tables involved.

Thanks and regards,

..matthew

PS. Using Vis C++6, Client is Win 2000 Pro, Server is Win 2000 Advanced
Server).

Scot T Brennecke

unread,
May 9, 2001, 10:43:54 AM5/9/01
to
See this article: "PRB: C Datatype's Pseudo Null Values Are Not Inserted into
SQL Database Correctly"
ID: Q231875

Matthew Stanfield

unread,
May 9, 2001, 12:23:34 PM5/9/01
to
Thanks Scot. IsFieldNull() is my baby.

..matthew

Ian McCoubrey

unread,
May 9, 2001, 1:01:12 PM5/9/01
to
See Knowledge Base article Q231875.

'1246576928' is '4a4d4120' in hex, this the pseudo-NULL value for long.

Ian.

"Matthew Stanfield" <mat...@propertyknowledge.com> wrote in message
news:3AF95577...@propertyknowledge.com...

0 new messages