TVirtualTable.LoadFromFile does not work

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
carlonarcisi
Posts: 29
Joined: Fri 10 Dec 2010 15:07

TVirtualTable.LoadFromFile does not work

Post by carlonarcisi » Fri 10 Dec 2010 15:45

I'm using postgres data 2.0

The problem is really very very simple.
At runtime I load 21,000 records into a table TVirtualTable,
SaveToFile C: \ XXX,
I close the program ..
Start program .. load data with LoadFromFile .. and It raise an exception in

VirtualTable at APPEND command Line 1521

for j := 0 to RecordCount - 1 do begin
Append;
try
for i := 0 to LocFieldDefs.Count - 1 do begin
Field := FieldArr;

Best Regard
Carlo Narcisi

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 13 Dec 2010 09:25

Hello,

Unfortunately, I can not can not reproduce the problem.
I have tested it on the following code:

Insert:
var
i: Integer;
begin
VirtualTable1.Open;
for i:=0 to 21000 do
begin
VirtualTable1.Append;
VirtualTable1['ID']:= i;
VirtualTable1['TEXT']:= 'Text_'+IntToStr(i);
VirtualTable1['DATE']:= date;
VirtualTable1.post;
end;
VirtualTable1.SaveToFile('e:\1.txt');

Load:

VirtualTable1.Open;
VirtualTable1.LoadFromFile('e:\64080.txt');

the fields were created manually.

Please try executing this code.

Post Reply