Difference between revisions of "SQLiteDatabase.Decrypt"

From Xojo Documentation

m (Example)
 
Line 14: Line 14:
  
 
<rbcode>
 
<rbcode>
Dim db As New SQLiteDatabase
+
Var db As New SQLiteDatabase
db.DatabaseFile = GetFolderItem("db.sqlite")
+
db.DatabaseFile = FolderItem.ShowOpenFileDialog("db.sqlite")
 
db.EncryptionKey = "howdy+doody"
 
db.EncryptionKey = "howdy+doody"
If db.Connect Then
+
Try
 +
  db.Connect Then
 
   db.Decrypt
 
   db.Decrypt
Else
+
Catch error As DatabaseException
 
   // handle error here
 
   // handle error here
End If
+
End Try
 
</rbcode>
 
</rbcode>

Latest revision as of 23:29, 29 July 2019

Method

SQLiteDatabase.Decrypt()

Supported for all project types and targets.

Decrypts an encrypted database. You must be connected to the database in order to decrypt it.

Example

This example decrypts an encrypted database:

Var db As New SQLiteDatabase
db.DatabaseFile = FolderItem.ShowOpenFileDialog("db.sqlite")
db.EncryptionKey = "howdy+doody"
Try
db.Connect Then
db.Decrypt
Catch error As DatabaseException
// handle error here
End Try