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




Reply With Quote
