ArchiveToDate(Stamp: DateTime; FileName: String; [Callback: IAuditLogArchiveCallback = Null]; [Format: AuditLogArchiveFormat = 0]; [ClearLog: Boolean = False]);
Stamp. Date limiting the last records that will be archived.
FileName. File name.
Callback. Object that is used to monitor archiving of access protocol.
Format. File format where the data is stored.
ClearLog. Parameter that determines deletion of record from the access protocol after archiving.
The ArchiveToDate method archives a part of the access protocol in the file.
The ClearLog parameter is set to False by default, records are not deleted. If the parameter is set to True, all saved records will be deleted from the access protocol after archiving.
The records starting with the first one and finishing with the last one, the date of which is earlier the date that is sent by the Stamp parameter, are archived in the file.
Executing the example requires the Gurnal_Part.csv file.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
AL: IAuditLog;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Open access protocol
Al := MS.OpenAuditLog;
// Save access protocol to file
AL.ArchiveToDate(DateTime.ComposeDay(2019, 01, 10), "C:\Gurnal_Part.csv", Null, 0, True);
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the records of access protocol starting with the first one and finishing with the last one that is earlier than 10.01.2019 are saved on the Gurnal_Part.csv file. These records are removed from the access protocol of the current repository after saving.
See also: