search
HomeDatabaseMysql Tutorial定期归档 Access 数据库记录

定期归档 Access 数据库记录

Jun 07, 2016 pm 03:11 PM
accessregularArchivedatabaseRecordUniversal

一个通用数据库任务会将记录从一个表归档到另一个表。如果您希望从原始表中删除不必要的记录以减小表的大小,但是将来可能会参考这些记录,那么您可以归档记录(而不是删除记录)。要在 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
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
What Are the Limitations of Using Views in MySQL?What Are the Limitations of Using Views in MySQL?May 14, 2025 am 12:10 AM

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

Securing Your MySQL Database: Adding Users and Granting PrivilegesSecuring Your MySQL Database: Adding Users and Granting PrivilegesMay 14, 2025 am 12:09 AM

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

What Factors Influence the Number of Triggers I Can Use in MySQL?What Factors Influence the Number of Triggers I Can Use in MySQL?May 14, 2025 am 12:08 AM

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

MySQL: Is it safe to store BLOB?MySQL: Is it safe to store BLOB?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

MySQL: Adding a user through a PHP web interfaceMySQL: Adding a user through a PHP web interfaceMay 14, 2025 am 12:04 AM

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.