Inserting null values in database through VC++ and ADO

I have some fields in database which can be null. The value for these fields come from screen and I don't know in advance whether it is going to be null or not. I want to construct SQL statement that will handle null values. In java there are parameterized queries where we can set paramater type as null for null values. How do I manage null values in VC++ and ADO.

regards,
Jatin.
[400 byte] By [jatinkulkarni] at [2007-11-20 10:40:03]
# 1 Re: Inserting null values in database through VC++ and ADO
CString strNull(_T("Null"));
CString strSQL = _T("UPDATE MyTable SET FIeld1 = ");
if(<field value was set>) // check if the value was set
{
strSQL += <its value>; // some new value
}
else // not set!
{
strSQL += strNull;
}Now use the Execute with this SQL query
VictorN at 2007-11-10 22:29:05 >
# 2 Re: Inserting null values in database through VC++ and ADO
Thanks Very Much,
That solves my problem.
jatinkulkarni at 2007-11-10 22:30:05 >