greenbird
asked on
Urgent!!!! strange! how to CORRECTLY use GetFieldValue(str)?
Hi,
i have a database file a.mdb, it has a field named "DOB" whose data type is "date/time". now i wnat to get the value of this field for a record:
COlevariant v1;
char *s1=(char *)malloc(10*sizeof(char));
v1=rs.GetFieldValue("DOB") ;
s1=(char *)v1.bstrVal;
however i can not get the value! if i change the data type to "text", then can get it (say 29/10/99).
any one knows how to get the field value with date/time data type?
Pls help! thanks a lot!
i have a database file a.mdb, it has a field named "DOB" whose data type is "date/time". now i wnat to get the value of this field for a record:
COlevariant v1;
char *s1=(char *)malloc(10*sizeof(char));
v1=rs.GetFieldValue("DOB")
s1=(char *)v1.bstrVal;
however i can not get the value! if i change the data type to "text", then can get it (say 29/10/99).
any one knows how to get the field value with date/time data type?
Pls help! thanks a lot!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CDaoRecordset* m_UserRecordSet;
//initializing m_UserRecordSet
....
....
//getting date/time
COleDateTime odt;
odt = m_UserRecordSet->GetFieldV alue("DOB" );
//COleDateTime = more functionality that CTime
//initializing m_UserRecordSet
....
....
//getting date/time
COleDateTime odt;
odt = m_UserRecordSet->GetFieldV
//COleDateTime = more functionality that CTime
that classes member functions.
regards,
mike.