How do I place records of two fields in a data table in a dynamic array? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061219114601222.html
Adoquery. close;
Adoquery. SQL. Clear;
Adoquery. SQL. Add ('select No, name from stu ');
Adoquery. open;
Place the NO and name values in a dynamic array with a total of about 40 records, so they are placed in the array to avoid frequent access to the database. Is that my idea? Please advise!
Previous tasks:
VaR
Vpose: olevariant;
// Create an array to be located when the data is output. The positioning data is obtained when the daily report data is checked.
Vpose: = vararraycreate ([0, adoquerytemp. RecordCount-1], varvariant );
Adoquerytemp. first;
For I: = 0 to adoquerytemp. RecordCount-1 do
Begin
Vpose [I]: = vararrayof ([adoquerytemp. fieldbyname ('indicator name'). value,
Adoquerytemp. fieldbyname ('destination row'). value,
Adoquerytemp. fieldbyname ('second row'). value,
Adoquerytemp. fieldbyname ('destination column'). value]);
Adoquerytemp. Next;
End;
Access this array element: vpose [I] [J]
Is vararray a dynamic array?