Load data from query

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ioda
Posts: 12
Joined: Fri 08 Feb 2008 15:11

Load data from query

Post by ioda » Wed 05 Aug 2009 17:50

Hi,

I would like to know how I can load records from query. I can use Assing() procedure but I don't want to reload the fields because I have more field in VirtualTable.

this is my code but it doesn't optimized

while not (lqryGrid.Eof) do
begin
dsetGrid.Append;
for I := 0 to dsetGrid.FieldCount - 1 do
begin
if (lqryGrid.FindField(dsetGrid.Fields.FieldName) nil) then
dsetGrid.Fields.AsVariant := lqryGrid.FieldByName(dsetGrid.Fields.FieldName).AsVariant;
end;
lqryGrid.Next;
end;

Thanks in advance

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 06 Aug 2009 08:37

You can use your code. The Assign method does the same except it recreates fields for VirtualTable.

Post Reply