IAuditLog.ArchiveToDate

Syntax

ArchiveToDate(

Stamp: DateTime;

FileName: String;

[Callback: IAuditLogArchiveCallback = Null];

[Format: AuditLogArchiveFormat = 0]);

Parameters

Stamp - a date that limits the last records that will be archived.

FileName - a name of the file.

Callback is an object that is used fro tracking the process of archiving of the access protocol.

Format is a format of the file in which the saving is executed.

ClearLog is a parameter that determines whether the records will be removed from the access protocol after archiving. The False value was set by default, the records are not removed. If the True value is set, all saved records are removed from the access protocol after archiving.

Description

The ArchiveToDate method archives the access protocol in the file, the name of which is passed by the FileName parameter.

Comments

The records starting with the first one and finishing with the last one, the date of which is earlier the date that is passed by the Stamp parameter, are archived in the file.

Example

Sub Main;

Var

MB: IMetabase;

MS: IMetabaseSecurity;

AL: IAuditLog;

Begin

MB := MetabaseClass.Active;

MS := MB.Security;

Al := MS.OpenAuditLog;

AL.ArchiveToDate(Stamp := DateTime.ComposeDay(2009, 03, 25), FileName := "c:\Gurnal_Part.csv", Format := AuditLogArchiveFormat.CSV, ClearLog := True);

End Sub Main;

After executing this example the records of access protocol starting with the first one and finishing with the last one that is earlier than "01.03.2009" are saved on the Gurnal_Part.csv file. These records are removed from the access protocol of the current repository after saving.

See also:

IAuditLog