Page 1 of 1

TUniLoader without Events in single procedure

Posted: Fri 13 Jul 2012 14:24
by miguelenguica
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;

Re: TUniLoader without Events in single procedure

Posted: Mon 16 Jul 2012 10:19
by AlexP
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.