Im maintaining a Delphi7 application that uses Paradox tables (BDEv126.96.36.199).
One of its functions is to export records from a table to a txt file in a fixed format. There are some 289 fields in the source table(s) and the user can export any number of these fields. The record length with all 289 fields is 4132 bytes. The export is successful when the number of fields to export is limited (that is, if the record size is 4096 bytes or less). However, if all the fields are exported, the app gets an error: "Access violation at address 4BDE68FC in module IDAPI32.DLL." The funny thing is that if there is only one record in the source table, all the fields can be exported successfully; on multiple records, it gets the access violation error.
When I ran it in debug mode, it was failing on the Post of the second record. Here is the gist of the code:
while not ExpSet.EOF do //while not last rec
Common.CopyRecordFldsByName(FldBuf, ExpSet); //copy fields
with FldBuf do if Assigned(BeforePost) then BeforePost(FldBuf);
CopyToText(IntMap); //copy values to txt
TblTextFile.Post; //<--- fails here on 2nd rec
on ESkipRecord do; //Do nothing
on E: Exception do
LogIxpError(GauImpExp.Progress + 1, E.Message);
if ChkAbortOnErr.Checked and
(FIxpErrCount >= BtnMaxErrors.Position) then
For anyone that can help me, I thank you in advance.