From Xojo Documentation

You are currently browsing the old Xojo documentation site. It will go offline as of October 2, 2023. Please visit the new Xojo documentation site! - you will be redirected shortly...


Used to get progress and status of SQLiteDatabase backups.

Complete Progress


This interface is used when you want to track the progress of an asynchronous backup of a SQLiteDatabase using SQLiteDatabase.Backup.

You create a class that implements this interface and then add code to the methods. The methods are called as the backup progresses.

The class must remain in scope while the backup is running.

Sample Code

Backing up the database asynchronously requires the use of a separate class that implements SQLiteBackupInterface.

Var backupFile As Folderitem
backupFile = FolderItem.ShowSaveFileDialog("", "backup.sqlite")

If backupFile Is Nil Then Return

// This is a property on the Window so that it stays in scope when the method exits
mBackupDB = New SQLiteDatabase
mBackupDB.DatabaseFile = backupFile
If mBackupDB.CreateDatabaseFile Then
// This is a property on the Window so that it stays in scope when the method exits
mBackupHandler = New BackupHandler

// The window has a progress bar that is updated as the backup progresses
mBackupHandler.BackupProgressBar = BackupProgress
mDB.BackUp(mBackupDB, mBackupHandler)
End If

A class called BackupHandler implements SQLiteBackupInterface and has code in these methods:


MessageBox("Backup Complete.")


MessageBox("There was an error during the backup: " + Str(errorCode))


If BackupProgressBar <> Nil Then
BackupProgressBar.Maximum = 100
BackupProgressBar.Visible = True
BackupProgressBar.Value = percent*100
End If

In addition, it has a public property for the progress bar:

BackupProgressBar As ProgressBar

Example Project

/Example Projects/Database/SQLite/SQLiteBackup

See Also