Yes, here is the script:
#include <File.au3>
#include <MsgBoxConstants.au3>
#include <SQLite.au3>
#include "sqlitebackup.au3"
_SQLite_Startup(@ScriptDir & "\sqlite3.dll")
If @error Then
MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!")
Exit -1
EndIf
;$ORIG_HANDLE = _SQLite_Open("DB1.db")
$ORIG_HANDLE = _SQLite_Open("DB2.db")
If @error Then
MsgBox($MB_SYSTEMMODAL, "SQLite Error", "Can't create a memory Database!")
Exit -1
EndIf
$hHandleDb = _SQLite_Backup($ORIG_HANDLE, ':memory:', Default, Default, Default, Default, -1)
MsgBox(4096, "", @error & ' ' & @extended & @LF)
_SQLite_Close($ORIG_HANDLE)
_SQLite_Shutdown()
Actually, I have tried it with 2 different Sqlite Databases.
DB2 is 13KB in size, and the above script works perfectly with that. DB2.db does gets copied to memory, and I can perform operations from memory.
However, DB1 is around 2 MB in size, and I get @error = 11, which corresponds to 11 - Error changing destination Db page_size
Does it have something to do with the size of Database ? Do I need to execute any Pragma statements before, in-order to work with large size DB ?