Page 1 of 1

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

Posted: 14.11.2011, 20:40
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

Posted: 17.12.2011, 20:47
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

Posted: 18.12.2011, 12:57
by papelhigienico
This can be done for all drivers, or not?

Posted: 18.12.2011, 15:04
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.

Posted: 21.12.2011, 21:54
by mdaems
papelhigienico,

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

Mark

Posted: 22.12.2011, 12:26
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.

Posted: 22.12.2011, 12:28
by papelhigienico
This is a good idea, simplify the application distribution, mainly on Windows, where users don't work with package dependency :)

Posted: 22.12.2011, 13:36
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.

Posted: 22.12.2011, 20:28
by papelhigienico
It was based on BTMemoryModule too... :(

Posted: 23.12.2011, 18:18
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.

Posted: 26.12.2011, 13:55
by papelhigienico
Sapiem

Where can I found InboxApp?

Posted: 28.12.2011, 21:43
by Sapiem
papelhigienico, give me an email and I'll send you. But if you want, look in Google

Posted: 29.12.2011, 00:47
by papelhigienico
Sapiem

send it to fabio at pascalscada dot com

OR

papelhigienico at gmail dot com

Posted: 29.12.2011, 01:18
by Sapiem
Sorry, the real name is BoxedApp, not InboxApp.