How do I place records of two fields in a data table in a dynamic array?

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.