Results 1 to 38 of 38

Thread: RC6 - New encrypt option for Sqlite DB: SqlCipher

Threaded View

  1. #9

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Location
    Brasil
    Posts
    68

    Re: RC6 - New encrypt option for Sqlite DB: SqlCipher

    Just change "OpenDB" to "CreateNewDB"... Like this:

    Code:
    Dim sCn As New cConnection
    
    '*** Define 'CodecType' before 'OpenDB'
    sCn.CodecType = CODEC_TYPE_SQLCIPHER
    
    '*** Inform the Path and NEW DB File
    '*** Do not enter the 'EncrKey' parameter here
    sCn.CreateNewDB "C:\Users\Th\Desktop\Cipher3_New.db"
    
    '*** Indicate that the file is a 'SqlCipher 3' (if the file is 'SqlCipher 4', it is also necessary to indicate here: legacy=4)
    sCn.Execute "PRAGMA legacy=3;"
    
    '*** Inform 'EncrKey' here, that way and after setting the 'legacy' parameter
    sCn.Execute "PRAGMA key=123;"
    
    '*** You have to create something in the DB for the password to be applied
    sCn.Execute "CREATE TABLE TabTabTab(a INT); DROP TABLE TabTabTab;"
    
    Set sCn = Nothing
    
    MsgBox "Ok!"

    --
    Thiago
    Last edited by ThiagoPSanches; May 25th, 2021 at 01:46 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width