Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can SQLite library embed (Link) to Delphi executable file?

Tags:

sqlite

delphi

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.

like image 621
Chau Chee Yang Avatar asked May 20 '11 10:05

Chau Chee Yang


4 Answers

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

like image 80
Sigurdur Avatar answered Nov 11 '22 07:11

Sigurdur


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.

like image 26
r4w8173 Avatar answered Nov 11 '22 05:11

r4w8173


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.

like image 4
Simvector Technologies Avatar answered Nov 11 '22 07:11

Simvector Technologies


Anydac SQLite driver has statically linked SQLite engine. It is commercial library, although. They has an article about anydac and sqlite.

like image 4
robmil Avatar answered Nov 11 '22 07:11

robmil