Xojo Conferences

« Accept file drops in … | Home | Real Studio 2012 Rele… »

SQLite Backup Functions

We are adding backup functions to our MBS Real Studio SQL Plugin. This way you can do online backups of your SQLite database. Even if your normal app uses SQLite using REALSQLDatabase class, you can still open a second connection with our plugin and do a backup while the database. Read about the backup functions in sqlite here.
Code is like this:

      dim s as SQLite3MBS = con.NativeAPI
dim b as SQLite3BackupMBS = s.BackupInit(conBackup, "main", con, "main")

if b<>nil then
while s.BackupStep(b, 100) = s.kErrorOk
// show progress

if s.Backupfinish(B) = s.kErrorOk then
MsgBox "backup okay"
end if
MsgBox "Failed to start backup."
end if

As you see, you get the native API of the SQL connection with the SQLite3MBS class. There you call backup methods there. You keep and pass the SQLite3BackupMBS object to the functions.
21 08 12 - 12:55
No comments

Remember personal info?

Emoticons / Textile

Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.