PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Example for using the HRestoreBackup function
HRestoreBackup (Example)
Example for using the HRestoreBackup function
Example for restoring a unique database found on the server.
// Variables
gnBckID is int
New_connection is Connection


// Connection parameters
New_connection..Provider = hAccessHFClientServer
New_connection..User = "PMO"
New_connection..Password = "password"
New_connection..Server = "MyHFServer"
New_connection..Database = "" // To restore a single database, don't enter anything here
New_connection..CryptMethod = hCryptNo


// Create the backup
Backup_Doc is hBackupDescription
Backup_Doc..Description = "Doc Backup"
Backup_Doc..WithIndex = True
Backup_Doc..Destination = "Backup"
Backup_Doc..Source = "031951/*"

gnBckID = HBackup(New_connection, Backup_Doc)
IF gnBckID = 0 THEN
Error(HErrorInfo())
ELSE
Info("Backup created, identifier:" + gnBckID)
END

// Close the connection
IF HCloseConnection(New_connection) = False THEN
Error(HErrorInfo())
ELSE
Multitask(100)
END

// Restore the backup
IF HRestoreBackup(New_connection, gnBckID) = False THEN
Error("Failure restoring the backup" + HErrorInfo(hErrMessage))
ToClipboard(HErrorInfo())
ELSE
Info("Restore operation successfully performed")
END
Minimum required version
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment