AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL Client/Server
  • Usage example of the HRestoreBackup function
HRestoreBackup (Example)
Usage example of 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..Encryption = hEncryptionNO
 
 
 
// 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
Versión mínima requerida
  • Versión 16
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/03/2023

Señalar un error o enviar una sugerencia | Ayuda local