Icon View Incident Report

Serious Serious
Reported By: Bill Zwirs
Reported On: 6/6/2010
For: Version 2.03 Build 14
# 3222 FreePascal/Lazarus Alignment Error When Referencing TDateTimeFields

I need to insert some data from a Firebird database (on PC) to an ElevateDB database on wince. The problem I am having is with a date field on the ElevateDB side. I am aware that the Firebird fbclient.dll for wince does have problems with date fields so to overcome this I have added a date string field in the appropriate table on the main database (PC) with the idea
to convert to a date value (DateToStr) in the wince program (and vice versa when I need to go the other way). So on the wince program have a query to get the data from the PC and loop through (while not Eof) to transfer the data. I create a variable dNextFill of type tDate and do the following inside the while...loop:

Every time it gets to the point where dNextFill is assigned to the table field I get the following message.

'Bus error or misaligned data access.'

while not PDADataModule.FillSchedQry.EOF do
begin
   dNextFill :=
StrToDate(PDADataModule.FillSchedQry.FieldByName('NEXTFILLSTR').AsString);
   PDADataModule.FillSchedTbl.Insert;
   PDADataModule.FillSchedTbl.FieldByName('MachID').asInteger :=
                 PDADataModule.FillSchedQry.FieldByName('MACHID').asInteger;
   PDADataModule.FillSchedTbl.FieldByName('SiteID').asInteger :=
                 PDADataModule.FillSchedQry.FieldByName('SITEID').asInteger;
   PDADataModule.FillSchedTbl.FieldByName('FillDate').AsDateTime := dNextFill;
   PDADataModule.FillSchedTbl.FieldByName('Filled').asBoolean := False;
   PDADataModule.FillSchedTbl.Post;
   PDADataModule.FillSchedQry.Next;
 end;



Comments Comments
This was an error in the FreePascal database package, and it has been corrected in EDB by overriding the TDataSet.DataConvert method.

The bug report for this issue is located at:

http://bugs.freepascal.org/view.php?id=16681


Resolution Resolution
Fixed Problem on 6/13/2010 in version 2.03 build 15


Products Affected Products Affected
ElevateDB LCL Standard with Source

Image