I do the following code:

_varian_t vValue;
long l;
vValue=pRecordset->Fields->GetItem(_variant_t(0L))->Value;
l=atol((char *)(_bstr_t)vValue);

but when I reach to a record have NULL value in this field, this code will cause an error.
So any body tell me how can I check the vValue was NULL before I call atol function.
Thanks so much.

Khinlau