_RecordsetPtr rec; rec.CreateInstance(_uuidof(Recordset)); CString cstrSQL; cstrSQL.Format("SELECT * FROM ... where ..."); rec->Open(_bstr_t(cstrSQL), (IDispatch*)g_pConnections, adOpenDynamic, adLockOptimistic, adCmdText); if(sName =="") //NULL { rec->PutCollect("name", VT_NULL); } else { rec->PutCollect("name",_variant_t("my name")); } rec->Update();