Databinding to datetime field of SQL Server
I am using OLEDB provider for SQL server to access the database. I am using the following code in VC++:
BEGIN_ADO_BINDING(MyClassderived from CAdoRecordBinding)
ADO_FIXED_LENGTH_ENTRY(1, adDBTimeStamp, mMyDateVar, status, FALSE)
END_ADO_BINDING()
where mMyDateVar is defined as:
COleDateTime mMyDateVar;
The problem is that on opening the recordset, I do not get any values in the mMyDateVar, but I do get the values if I replace adDBTimeStamp by adDate as in:
ADO_FIXED_LENGTH_ENTRY(1, adDate, mMyDateVar, status, FALSE)
Help on ADO etc indicate that I should be using adDBTimeStamp and not adDate to access data from SQL Server. Please respond if you have any clues/suggestions since I need to resolve this issue urgently.
Thanks in advance,
Cruiser

