vc++ ado NULL

I have worked in  VB 6.0 ADO ,there i found a method ISNULL to check a field item is null or not.
I am currently in VC++ 6.0 Ado, i am not able to find such a method . How could i test a field is
null.
v_iyengarAsked:
Who is Participating?
 
GGRUNDYConnect With a Mentor Commented:
No ....
I mean that's what "I" would do x.vt == VT_NULL,
but I would do it without great confidence because the
documentation is really crappy.
0
 
AxterCommented:
if (ptr == NULL)
{
}
0
 
v_iyengarAuthor Commented:
i want to check if Fields->GetItem(0l)->Value is null
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
AxterCommented:
if (Fields->GetItem(0l)->Value == NULL)
{
}
0
 
AxterCommented:
If you want to check if the return value of GetItem is null then you can do the following:
if (Fields->GetItem(0l)== NULL)
{
}
0
 
AxterCommented:
If Value is a non-pointer, then I think what you're looking for is something like this.

if (Fields->GetItem(0l)== NULL)
{
  MyValue = Fields->GetItem(0l)->Value;
}
0
 
AxterCommented:
Oops!  Correction:
if (Fields->GetItem(0l) != NULL)
{
 MyValue = Fields->GetItem(0l)->Value;
}
0
 
v_iyengarAuthor Commented:
i want to check with database null
0
 
AxterCommented:
>>i want to check with database null
What do you mean?

What ever you have as a pointer, should be checked to see if the value equals to NULL.
0
 
v_iyengarAuthor Commented:
the value for an item in database can be NULL.
How can i check its null
Fields->GetItem(0l)->Value is a VARIANT ,how can i compare a VARIANT and NULL
0
 
GGRUNDYCommented:
I think in the case of a NULLable charater field the variant type returned will be of type VT_NULL if the field is NULL.
0
 
v_iyengarAuthor Commented:
the value for an item in database can be NULL.
How can i check its null
Fields->GetItem(0l)->Value is a VARIANT ,how can i compare a VARIANT and NULL
0
 
v_iyengarAuthor Commented:
the value for an item in database can be NULL.
How can i check its null
Fields->GetItem(0l)->Value is a VARIANT ,how can i compare a VARIANT and NULL
0
 
v_iyengarAuthor Commented:
the value for an item in database can be NULL.
How can i check its null
Fields->GetItem(0l)->Value is a VARIANT ,how can i compare a VARIANT and NULL
0
 
v_iyengarAuthor Commented:
yes vt type is set to VT_NULL
But will all database will do the same,set VT to VT_NULL or i have to check some other code like scode
0
 
v_iyengarAuthor Commented:
yes vt type is set to VT_NULL
But will all database will do the same,set VT to VT_NULL or i have to check some other code like scode
0
 
v_iyengarAuthor Commented:
yes vt type is set to VT_NULL
But will all database will do the same,set VT to VT_NULL or i have to check some other code like scode
0
 
GGRUNDYCommented:
Sorry but after lots of ploughing through documentation I can't find anything which gives me confidence that comparing against VT_NULL will be reliable in all weather. But I'm guessing it will probably be as reliable as your original VB test was.
0
 
v_iyengarAuthor Commented:
yes vt type is set to VT_NULL
But will all database will do the same,set VT to VT_NULL or i have to check some other code like scode
0
 
v_iyengarAuthor Commented:
so you mean ISNULL in vb only test for VT=VT_NULL
0
 
GGRUNDYCommented:
As VB uses a variant type internally that is my suspicion.
0
 
v_iyengarAuthor Commented:
so u mean to say its enough if i check VT=VT_NULL ?
0
 
MindphaserCommented:
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
0
 
v_iyengarAuthor Commented:
i am also doing the same,but i do not know is it correct?
0
 
griesshCommented:
I suggest to split between Axter and GGRUNDY

======
Werner
0
 
MindphaserCommented:
Force accepted

** Mindphaser - Community Support Moderator **

Axter, there will be a separate question with points for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.