Home Database Mysql Tutorial 定期归档 Access 数据库记录

定期归档 Access 数据库记录

Jun 07, 2016 pm 03:11 PM
access regular Archive database Record Universal

一个通用数据库任务会将记录从一个表归档到另一个表。如果您希望从原始表中删除不必要的记录以减小表的大小,但是将来可能会参考这些记录,那么您可以归档记录(而不是删除记录)。要在 Microsoft Access 数据库中归档记录,请用宏来运行查询,将记录从一个表

  一个通用数据库任务会将记录从一个表归档到另一个表。如果您希望从原始表中删除不必要的记录以减小表的大小,但是将来可能会参考这些记录,那么您可以归档记录(而不是删除记录)。要在 Microsoft Access 数据库中归档记录,请用宏来运行查询,将记录从一个表移到另一个表。

  注意 以下过程使用的是罗斯文示例数据库中的示例。罗斯文示例数据库的默认位置是 Program Files\Microsoft Office\Office10\Samples 文件夹。如果您的 Samples 文件夹中没有 Northwind.mdb 文件,或者您需要有关打开罗斯文的详细信息,请在 Office 助手或“帮助”窗口的“应答向导”选项卡中输入“打开罗斯文示例数据库”,然后单击“搜索”。

  定期将记录从一个表归档到另一个表

  1、使用“复制”和“粘贴”命令,将要归档的表复制到新表中。仅复制结构,不复制数据。

  例如,将“产品”表的结构复制到名称为“产品归档”的新表中。

  2、创建一个查询,使其包含“产品”表中所有的字段,并将记录附加到“产品归档”表中。设置条件来指定要归档的记录的子集。

  例如,创建一个名为“产品附加”的附加查询,通过将“中止”字段的“条件”单元格设置为 -1,就可以仅向“产品归档”表中附加中止的条目。

  提示 如果每次归档的条件都会发生变化,那么您可以创建一个带有提示参数的附加查询,这样在每次运行查询时就可以输入不同的条件。

  3、创建一个删除查询,此查询的条件与步骤 2 中为附加查询指定的条件相同。您将使用此查询从“产品”表中删除在步骤 2 中附加的记录。

  例如,创建一个“产品删除”删除查询,此查询的条件与“产品附加”附加查询所指定的条件相同。

  注意 如果您创建一个提示输入参数的附加查询,那么您应该也创建一个提示输入相同参数的删除查询,并且对每次运行查询出现的参数提示,要确保输入相同的值。

  4、创建一个宏,使其先运行附加查询,然后运行删除查询。

  例如,创建一个名为“产品附加记录”的宏,在宏的第一行用 OpenQuery 操作来运行附加查询,在宏的第二行用 OpenQuery 操作来运行删除查询。

  5、每次您要归档记录时,请运行“产品附加记录”宏。


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

What are the benefits of multithreading in c#? What are the benefits of multithreading in c#? Apr 03, 2025 pm 02:51 PM

The advantage of multithreading is that it can improve performance and resource utilization, especially for processing large amounts of data or performing time-consuming operations. It allows multiple tasks to be performed simultaneously, improving efficiency. However, too many threads can lead to performance degradation, so you need to carefully select the number of threads based on the number of CPU cores and task characteristics. In addition, multi-threaded programming involves challenges such as deadlock and race conditions, which need to be solved using synchronization mechanisms, and requires solid knowledge of concurrent programming, weighing the pros and cons and using them with caution.

How to avoid third-party interfaces returning 403 errors in Node environment? How to avoid third-party interfaces returning 403 errors in Node environment? Apr 01, 2025 pm 02:03 PM

How to avoid the third-party interface returning 403 error in the Node environment. When calling the third-party website interface using Node.js, you sometimes encounter the problem of returning 403 error. �...

Unable to log in to mysql as root Unable to log in to mysql as root Apr 08, 2025 pm 04:54 PM

The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

MySQL: An Introduction to the World's Most Popular Database MySQL: An Introduction to the World's Most Popular Database Apr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

How to use sql if statement How to use sql if statement Apr 09, 2025 pm 06:12 PM

SQL IF statements are used to conditionally execute SQL statements, with the syntax as: IF (condition) THEN {statement} ELSE {statement} END IF;. The condition can be any valid SQL expression, and if the condition is true, execute the THEN clause; if the condition is false, execute the ELSE clause. IF statements can be nested, allowing for more complex conditional checks.

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

How to efficiently obtain component_verify_ticket in EasyWechat 5.5? How to efficiently obtain component_verify_ticket in EasyWechat 5.5? Apr 01, 2025 pm 12:42 PM

Get ComponentVerify in EasyWechat5.5...

See all articles