views:

192

answers:

1

Hi,

I need to get value of column (TIMESTAMP) from oracle DB into C++. Then which dataype i should map to access database field (In MFC or WinAPI any) or what should in do to do this in proper manner.

Thanks, Anuj Seharavat

edit

Additional info: I need to fetch data from database. I am using CRecordset class and function RFX_Date is used there in DoFieldExchange(). RFX_Date has three forms (using CTime, TIMESTAMP_STRUCT and COleDateTime). Using Oracle at backend. I tried all three versions but not getting the values from database.

NB: additional info extracted from OP comment to response.

A: 

You could read the timestamp into a time type:

std::istringstream i( timestamp_string );
std::time_t t;
i >> t;

Take a look at the ctime header for a description on time_t if you need it.

Peter Jansson
Anuj Seharavat