Ado Dataset DateTime field rounding the secconds and milliseconds to the minute


2005-08-23 11:19:07 PM
delphi74
I have an ADODataSet that is created in memory.
I have a date time field that has seconds and milliseconds. When I post the
ADODataSet record the time field is rounded to minutes.
Value before post : 08/08/2005 07:00:59.990
After Post : 08/08/2005 07:01:00.000
D5 ADO
CreateDataSet code:
{------------------------------------------------------------------------------}
try
dbsAdoAPLbr := TAdoDataSet.Create(Session);
if Assigned(dbsAdoAPLbr) then
begin
dbsAdoAPLbr.CursorLocation := clUseClient;
dbsAdoAPLbr.Connection := Nil;
dbsAdoAPLbr.FieldDefs.Clear;
dbsAdoAPLbr.FieldDefs.BeginUpdate;
{Add Fields}
{-----------------}
with dbsAdoAPLbr.FieldDefs.AddFieldDef do
begin
Name := 'APL_EMPNBR';
DataType := ftString;
Size := 9;
Required := True;
end;
with dbsAdoAPLbr.FieldDefs.AddFieldDef do
begin
Name := 'APL_STIME';
DataType := ftDateTime;
Required := False;
end;
{-----------------}
with dbsAdoAPLbr.FieldDefs.AddFieldDef do
begin
Name := 'APL_HOURS';
DataType := ftFloat;
Required := True;
end;
{-----------------}
with dbsAdoAPLbr.FieldDefs.AddFieldDef do
begin
Name := 'APL_DOLLARS';
DataType := ftFloat;
Required := True;
end;
dbsAdoAPLbr.FieldDefs.EndUpdate;
dbsAdoAPLbr.CreateDataSet;
if dbsAdoAPLbr.Active then
dbsAdoAPLbr.Active := True;
end;
except
on E: Exception do
begin
UniMsgs.UpdLogInfo('', Format('%s Error Creating Ado AP Lbr Dataset:
%s',
[MSG_BASE, e.message]), ueErr);
end;
end;
end;
Does anyone know how I can get the ADODataSet to keep the complete date and
time value when the record is posted.
Thanks for any help,
Cheral