TUniLoader without Events in single procedure

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
miguelenguica
Posts: 18
Joined: Mon 11 Apr 2011 15:28

TUniLoader without Events in single procedure

Post by miguelenguica » Fri 13 Jul 2012 14:24

Hi. What's the downside of using TUniLoader like this?

Code: Select all

myLoader:= TUniLoader.Create(nil);
myLoader.Connection:= someConnection;
myLoader.TableName:= 'some_table';
myLoader.CreateColumns;
//
for count_row := 1 to something do
begin
  myLoader.PutColumnData('field1', count_row, val1);
  myLoader.PutColumnData('field2', count_row, val2);
end;  
//
myLoader.Load;
myLoader.Free;

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

Re: TUniLoader without Events in single procedure

Post by AlexP » Mon 16 Jul 2012 10:19

hello,

UniLoader allows data loading only in the onGetColumnData and onPutData events (the examples of work with these events are in the help), therefore you need one of these events for data loading.
P.S. Your code will cause AccessViolation when calling the PutColumnData method.

Post Reply