kingservant
asked on
How do you evaluate for NULL in ADO
I am trying to retrieve the value of a field that could be NULL. I do this by using the following call:
strcpy(string, (LPCSTR)(_bstr_t)pFields-> GetItem(vt Index)->Va lue);
My database allows fields to be NULL. Therefore, unless I want to keep receiving an exception error, I need to check the value for NULL. Problem is, I'm not sure how to do that.
Can someone help?!?
strcpy(string, (LPCSTR)(_bstr_t)pFields->
My database allows fields to be NULL. Therefore, unless I want to keep receiving an exception error, I need to check the value for NULL. Problem is, I'm not sure how to do that.
Can someone help?!?
BTW.. About the NULL, try catch() is the solution, but still suggest using GetRows(-1). The -1 is for all records.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Out of all the people who have responded to me on this forum, you have got to be the best! Thanks for your response, complete with code examples and links, I love it. I'll grade your answer tomorrow after I get to work. BTW, do you have any other suggestions I could make to my code to make it more efficient?
ASKER
Thanks for you response. You're the best!
ASKER
Thanks for you response. You're the best!
I have an example of this up on:
http://www.chizl.com/dev/c++/
Let me know if you have any questions about it.