How can I use sqlite3.dll embed inside App as resource

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

How can I use sqlite3.dll embed inside App as resource

Post by Sapiem »

Hello:

How can I use sqlite3.dll embed inside App as resource? I can use sqlite functions directly using sqlite3.dll as resource, loading with BTMemoryModule, but, Zeos need the file in the root of the app, no recognise it from memory

This will be the best for developers, beause Zeos is very helpfull and strong, but need the sqlite3.dll plus the app.

Thanks
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

When reading this, I think you could 'simply' edit ZPlainSqliteDriver.pas and add a new TZSQLiteBaseDriver descendent TZSqlite3ResourcePlaindriver and override TZSQLiteBaseDriver.Create and TZSQLiteBaseDriver.LoadAPI.
Then edit ZDbcSQLite.pas to 'register' this new Plaindriver.

If you can make that work, please share your eperience and code here, so we can evaluate if it's reasonable to put it into zeoslib.

Mark
Image
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

This can be done for all drivers, or not?
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

Post by Sapiem »

I solved the problem using InboxApp that simulate virtual files. It's for me, so don't matter if it's trial. But if somebody can do that you said, will be so usefull. I can't do it myself.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

papelhigienico,

Not sure if it works for drivers using more than just one dll.

Mark
Image
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

Hi Mark!

What I think is a lot of resources, each one storing a DLL of a specific driver. I'm studding the BTMemoryModule.

The first problem is the licence of BTMemoryModule. Currently it licensed with Mozilla Public License Version 1.1. I don't know if it can be used/distributed directly with ZeosLib.

The second problem is portability. BTMemoryModule can be compiled with Delphi/Lazarus only on Windows 32 bits. I'm thinking in port it to Linux 32/64 bits.
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

This is a good idea, simplify the application distribution, mainly on Windows, where users don't work with package dependency :)
Zoran
Senior Boarder
Senior Boarder
Posts: 55
Joined: 07.05.2010, 22:32

Post by Zoran »

I found this article in Lazarus Wiki: http://wiki.lazarus.freepascal.org/fb_embedded2_Laz

It describes the way how to include firebird embeded dll in exe file. I haven't tested it myself.

The author claims success with Zeos components:
The good thing is that your data-access components will work with embedded database, without change. For example, I use Zeoslib. Compiled .exe works without DLLs distributed.
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

It was based on BTMemoryModule too... :(
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

Post by Sapiem »

I still using InboxApp and over x64, all work fine, perfect. The application only increase the side adding the sqlite3.dll size. I try BTMemoryModule, but can´t do it. The best way is using InboxApp.
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

Sapiem

Where can I found InboxApp?
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

Post by Sapiem »

papelhigienico, give me an email and I'll send you. But if you want, look in Google
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

Sapiem

send it to fabio at pascalscada dot com

OR

papelhigienico at gmail dot com
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

Post by Sapiem »

Sorry, the real name is BoxedApp, not InboxApp.
Post Reply