Regular archiving of Access databases

Source: Internet
Author: User
A common database task archives records from one table to another. If you want to delete unnecessary records from the original table to reduce the table size, but may refer to these records in the future, you can archive records (instead of deleting records ). To be in Microsoft? Use a macro to run the query.

A common database task archives records from one table to another. If you want to delete unnecessary records from the original table to reduce the table size, but may refer to these records in the future, you can archive records (instead of deleting records ). To be in Microsoft? Use a macro to run the query.


A commonDatabaseThe task will record from a tableArchiveTo another table. If you want to delete unnecessary records from the original table to reduce the table size, but you may refer to these records in the future, you canArchiveRecords (instead of deleting records ). To be in Microsoft? AccessDatabaseMediumArchiveRecord. Use a macro to run the query and move the record from one table to another.

Note: The following process uses the rose Text Example.Database. Rose exampleDatabaseThe default location is the Program FilesMicrosoft OfficeOffice10Samples folder. If your Samples Folder does not contain any Northwind. mdb file, or you need to open the rose text details, please enter the "open the rose Text Example" in the "Answer wizard" tab of the Office assistant or "help" WindowDatabaseAnd then click search ".

  RegularTransfers records from a tableArchiveTo another table

1. Use the copy and paste commandsArchiveTo the new table. Only copy structure, not data.

For example, copy the structure of the "product" table to the table named "product ".Archive.

2. Create a query to include all the fields in the "product" table and add the record to the "product" table.Archive"Table. Set conditions to specifyArchive.

For example, to create an additional query named "Product APPEND", you can onlyArchive"To add the aborted entries in the table.

Tip: IfArchiveYou can create an additional query with the prompt parameter, so that you can enter different conditions each time you run the query.

3. Create a delete query. The query conditions are the same as those specified for the additional query in step 2. You will use this query to delete the records attached in step 2 from the products table.

For example, if you create a "delete product" query, the query conditions are the same as those specified in the "Additional Product" query.

Note: If you create an additional query that prompts you to enter parameters, you should also create a delete query that prompts you to enter the same parameters, and the parameter prompt appears for each running query, make sure to enter the same value.

4. Create a macro to run the additional query and then run the delete query.

For example, create a macro named "Product additional record", use the OpenQuery operation in the first row of the macro to run the additional query, and use the OpenQuery operation in the second row of the macro to run the delete query operation.

5. Each time you wantArchiveWhen recording, run the "Additional Product record" macro

Author: Unknown

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.