寫入時間值
COleDateTime oleDate = COleDateTime::GetCurrentTime();
_variant_t vtFld;
vtFld.vt = VT_DATE;
vtFld.date = oleDate;
pRecordSet4->PutCollect("date", vtFld);
讀時間值
_bstr_t TheValue=m_pset->FIElds->GetItem("出生年月")->Value;
temp=(char *)TheValue;
COleVariant vtime(temp);
vtime.ChangeType(VT_DATE);
COleDateTime time4=vtime;
m_time=time4;
UpdateData(FALSE);
也可以直接當字符串插入,但一定要注意格式!