How to work with Sqlite3 database in inno setup. Which dll files and interface functions should be used. Need to perform read, write and traverse operations.
Asked
Active
Viewed 1,360 times
1 Answers
2
You could include the sqlite3.exe
tool into the setup, and call it to execute your commands:
[Run]
Filename: "{tmp}\sqlite3.exe"; Parameters: """{userappdata}\MyProg\MyData.db"" ""INSERT INTO MyTable VALUES(1,2,3)"""; Flags: runhidden
Using SQLite's C API directly from InnoSetup would be rather complex. The easiest way would be to write your own .exe or .dll and call it from the setup.

CL.
- 173,858
- 17
- 217
- 259
-
Thanks for reply. Can you recommend me any dll file to for quick use. – raj Aug 01 '13 at 14:15
-
There is none; you have to write your own. – CL. Aug 01 '13 at 14:38
-
This worked perfectly, I just had to put the path of the file in quotation marks because there were spaces. +1 `"""{userappdata}\MyProg\MyData.db"" ""INSERT INTO MyTable VALUES(1,2,3)"""` – Roberto Fagundes Jan 14 '19 at 22:21
-
@CL.-- you don't have to write your own. There are precompiled libraries and executables located here: https://sqlite.org/download.html – Andy Feb 18 '19 at 14:06
-
@Andy And how would you use it directly from InnoSetup? The C API is not suited for quited use. – CL. Feb 18 '19 at 15:34
-
There is an `sqlite3.exe` file in the `sqlite-tools-win32-x86-3270100.zip` package. You can also import DLLs (http://www.jrsoftware.org/ishelp/index.php?topic=scriptdll) if you don't want to use a CLI. – Andy Feb 18 '19 at 16:32
-
I may have mis-read the question. Sorry about that. I thought he was asking for sqlite.exe, not a DLL. – Andy Feb 18 '19 at 16:33