DELPHI7 implementation of "carry" for adding records

Source: Internet
Author: User

In the database management system, the data input is the basic function of the processing, the input operation is convenient or not is one of the indexes of evaluating the interaction of database application. In addition to the input data should be entered into the legal test, should also provide users with more convenient operation, that is, "normative" data, such as: gender, title and other fields of data, should be as far as possible for users to "select" input, rather than direct text entry, in addition, such as: birth date, contact telephone, postcode and other similar names of fields, Program should be set up data entry format, which can be to a certain extent, "standard" data, and improve the speed of input. In addition, in the large amount of data entry, the user also want to more quickly similar data batch input, to achieve efficient data processing. This article only introduces the "batch data" input processing.

For most of the record data to be entered with the existing (that is, entered) data has more or less the same content, therefore, modify the record of a small number of field data is undoubtedly more quickly than the field-by-text input. Because this method originates from the "Set Carry On" command of the Foxbase system, it is named record "carry". The following details the implementation of the "carry" function in this data entry.

Create a dynamic array that holds all the field values for the entire record (excluding types such as Memo type), defined as follows:

Mydynamic_record:variant; Defines a dynamically variable array that holds the field values for the current record

Note that the number of array cells and cell value types are not qualified here, and are more versatile.

In the InsertBefore event of the Table object, the reading of the source data is completed and stored in the dynamic array Mydynamic_record.

Specifically, the user navigates to the record location to be the source (either a final record or a middle record), before inserting with the Insert key (or a key or button provided by another application) Adds code that reads the values of each field in the current record for the InsertBefore event of the Table object (see the following myrecordscatto () Custom function) and is stored in the Mydynamic_record.

Third, write the Mydynamic_record array value to the field values of the new record in the InsertAfter event of the Table object (see the following My_gathfrom custom functions for your code).

Related Article

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.