Promotic
WikipediaLinkedInYoutubeTwitterFacebook

BackupInfo - method of object PmTrend

Description:
Getting information about saved data on the disk.
Syntax:
BackupInfo(sType As String, nParType As Long, vPar As Variant) As Variant
Calling:
vInfo = oTrend.BackupInfo(sType, nParType, vPar)
Parameters:
sType(String) Type of the required information that has to be returned by the method.
"bckcount" - The method returns the number of still created backup files. If the backup type configurator Storage type is set to the option not supporting the backup (see Note), then the method always returns 1.

The nParType parameter is set 0.

"bckcountmax" - The method returns the maximum number of backup files. If the backup type configurator Storage type is set to the option not supporting the backup (see Note), then the method always returns 1.

The returned value corresponds to setting the Backups count configurator in Database Access backups (obsolete) or in Database MS SQL server backups (obsolete).

The nParType parameter is set 0.

"name" - The method returns the system name of one backup specified by the parameters nParType, vPar. If the backup type configurator Storage type is set to the option not supporting the backup (see Note), then the method returns the name of table or data file.

The nParType parameter is set to one of the options 10,20,21,30.

"title" - The method returns the user name of one backup specified by the parameters nParType,vPar. If the backup type configurator Storage type is set to the option not supporting the backup (see Note), then the method returns the name of table or data file.

The nParType parameter is set to one of the options 10,20,21,30.

Note: The user name can be entered by a script in each backup by setting the NewTitle parameter in the onBackupCreate event.

"reccount" - The method returns the number of still saved records in the backup specified by the parameters nParType,vPar. If the backup type configurator Storage type is set to the option not supporting the backup (see Note), then the method always returns the number of all saved records.

The nParType parameter is set to one of the options 10,20,21,30.

"timeoldest" - If the concrete backup is specified in the parameters nParType,vPar (one of the options 10,20,21,30 is set), then the method returns the time of the oldest record of the backup. If the concrete backup isn't specified in the parameters nParType,vPar (the option 0 is set), then the method returns the time of the oldest record of all backups.

If the backup type configurator Storage type is set to the option not supporting the backup (see Note), then the method returns the time of the oldest record.

The parameter can be set even in the form timeoldest:winter, then the method always returns the "standard time" (in the daylight-saving and standard seasons), otherwise it returns the "local time" (corresponds to the computer time according to the local settings).

"timenewest" - If the concrete backup is specified in the parameters nParType,vPar (one of the options 10,20,21,30 is set), then the method returns the time of the newest record of the backup. If the concrete backup isn't specified in the parameters nParType,vPar (the option 0 is set), then the method returns the time of the newest record of all backups.

If the backup type configurator Storage type is set to the option not supporting the backup (see Note), then the method returns the time of the newest record.

The parameter can be set even in the form timenewest:winter, then the method always returns the "standard time" (in the daylight-saving and standard seasons), otherwise it returns the "local time" (corresponds to the computer time according to the local settings).

nParType(Long) Specifies the type of value expected in the vPar parameter.
0 - The method works with all data of all backups. The vPar parameter is set to 0.
10 - The method works with the backup specified by the index. The value 0 set in the vPar parameter means the current backup (the backup where the current records are written). The higher index, the older backup. The value -2 set in the vPar parameter means the oldest backup.
20 - The method works with the backup specified by the time set in the vPar parameter, i.e. the backup is searched so that the time entered in the vPar parameter is inside the interval between the time of the oldest and the newest record of the backup.

The time entered in the vPar parameter is expected as the "local time" (corresponds to the computer time according to the local settings).

21 - The same as the previous option, only the time entered in the vPar parameter is expected as the standard time (even in the daylight-saving time).
30 - The method works with the backup specified by the name (e.g. the name of a database table).
vPar(Variant) Value of the parameter depends on the vParType parameter
Note:

The behavior of the method is affected by setting the backup type configurator Storage type. The backup type can be set to support the backup (see Database Access backups (obsolete), Database MS SQL server backups (obsolete)) or not to support the backup (see Promotic binary file cyclic, Database Access cyclic, Database MS SQL server cyclic, Database Oracle cyclic, Database MySQL cyclic), Database FireBird cyclic.

Example:
tTime = oTrend.BackupInfo("timeoldest", 0, 0) ' Time of the oldest saved record from all backups
tTime = oTrend.BackupInfo("timenewest", 0, 0) ' Time of the newest saved record from all backups
tTime = oTrend.BackupInfo("timeoldest", 10, 0) ' Time of the oldest saved record from the current backup
tTime = oTrend.BackupInfo("timenewest", 10, 0) ' Time of the newest saved record from the current backup
tTime = oTrend.BackupInfo("timeoldest", 10, -2) ' Time of the oldest saved record from the oldest backup
tTime = oTrend.BackupInfo("timenewest", 10, -2) ' Time of the newest saved record from the oldest backup
sTitle = oTrend.BackupInfo("title", 20, Now - 1/24) ' User name of the backup that is specified by the time
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice