Reputation: 19600
I am wondering if we able to embed SQlite library into Delphi executable file and we may deploy our application as single .exe file without any SQlite dll file.
The embed is not keep the sqlite dll file into resource but link to Delphi executable file.
Upvotes: 9
Views: 6365
Reputation: 86
I had the same problem and this is the solution I came up with. Maybe it can help you. Just include sqlite3 and you then have direct access to the dll functions. I used the same methods that have already be outlined: http://simvector.com/download/delphi_sqlite3.zip
The DLL is just encoded in source form and the DLLLoader unit loads it at runtime. The end result is no extra DLL in your distro at the expense of it all being loaded into memory at once vs parts loaded on demand via the OS.
We needed it to work as normal, yet no extra dll in distro. So works for our needs.
Upvotes: 4
Reputation: 608
We have compiled SQLite3 with Borland's free command line tools C compiler and the resulting OBJ file we linked in Delphi with {$LINK 'OBJS\sqlite3.obj'}, and written the pascal wrappers for the functions we needed.
There was a problem resolving some standard C library functions when linking but we re-implemented them in Delphi.
Upvotes: 5
Reputation: 47729
You can download the SQLite open source and compile it into any environment that can compile vanilla C code. It's not especially hard.
Upvotes: 0
Reputation:
Delphi can link .obj files, thereby if you have them available (or source code to compile them), you can link them into an executable. But you can't to that with the SQLLite dll.
IIRC DISQLite 3 does exactly that, check it.
Upvotes: 1
Reputation: 312
Anydac SQLite driver has statically linked SQLite engine. It is commercial library, although. They has an article about anydac and sqlite.
Upvotes: 4
Reputation: 417
I have not tried this component out, but I plan to in the future Delphi Inspiration - DISQLite3
There is also Synopse OpenSource SQLite3 Framework
A Freeware version is available too
Upvotes: 6