which database to a program ? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
arno03
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Feb 24, 2005 4:50 pm
Location: Paris
Contact:

which database to a program ?

Post by arno03 » Sun Aug 21, 2005 3:38 pm

Hi

I would like to do a program which contains a database but I don't wan't the user to need to install a supplementary program. In fact, the database must be integrated in the program.
I think wxsqlite is the good system, am I right ?

thx
Last edited by arno03 on Mon Aug 22, 2005 6:14 pm, edited 1 time in total.

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte » Sun Aug 21, 2005 3:56 pm

also FireBird.
Nothing to install as "embeded" (at least in FB1.5), multi-platform native support, and good performances.

http://firebird.sourceforge.net/

emarti
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 210
Joined: Sat May 07, 2005 8:24 pm
Location: Eskisehir, TURKEY
Contact:

Post by emarti » Sun Aug 21, 2005 4:51 pm

Your comment about sqlite ?

ssigala
Earned some good credits
Earned some good credits
Posts: 109
Joined: Fri Sep 03, 2004 9:30 am
Location: Brescia, Italy

Re: which database to a program ?

Post by ssigala » Sun Aug 21, 2005 5:28 pm

arno03 wrote:Hi

I would like to do a programme which contains a database but I don't wan't the user to need to install a supplementary program. In fact, the database must be integrated in the program.
I think wxsqlite is the good system, am I right ?

thx
SQLite is simply excellent for embedding:
* small
* fast
* enough features for most applications
Sandro Sigala - Kynosoft, Brescia

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte » Sun Aug 21, 2005 6:23 pm

SQLite may not handle all the database features (such as triggers, blob for binary data, ...)
You may need to check what you want to do exactely with your database, and see if the SQL engine supports everything required.

That's the main reason why I use FireBird, and not SQLite.

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Mon Aug 22, 2005 6:52 am

Hi!
Starting with version 3 SQLite can handle BLOBs and triggers. In fact most SQL features are covered now. You will have to use wxSQLite3 in order to use these features (http://wxcode.sourceforge.net/components/wxsqlite3/). Another option is this wrapper http://www.codeproject.com/database/CppSQLite.asp.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

Frank
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Jan 01, 2005 6:19 pm

Post by Frank » Mon Aug 22, 2005 7:35 am

<Nitpick> SQLite 2.x has triggers too. And I'm storing Binary-Data in a SQLite 2.x Database (requieres an encoding/decoding, wich is part of SQLite, binaryDecode/binaryEncode as far as I remember) </Nitpick>

arno03
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Feb 24, 2005 4:50 pm
Location: Paris
Contact:

Post by arno03 » Mon Aug 22, 2005 12:34 pm

thx all :wink:
I download wxsqlite3 on http://wxcode.sourceforge.net/components/wxsqlite3,
and I did somes transfers:

-----------------------------------------------------------------------------------
wxsqlite3/include/sqlite3.h -> C:/DevCpp/include/

wxsqlite3/include/lib/sqlite3.dll -> C:/DevCpp/lib/
wxsqlite3/include/lib/sqlite3.exp -> C:/DevCpp/lib/
wxsqlite3/include/lib/sqlite3.lib -> C:/DevCpp/lib/

wxsqlite3/include/wx/wxsqlite3.h -> C:/DevCpp/include/wx/
wxsqlite3/include/wx/wxsqlite3def.h -> C:/DevCpp/include/wx/
------------------------------------------------------------------------------------

After I try to compil minimal.cpp but i receive somes errors :
http://lmdf.free.fr/log.txt

why plz ? :?
ArNo

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Mon Aug 22, 2005 12:46 pm

You will have to compile wxSqlite3 as a static lib itself. Set up a static lib project and compile the file in /src. Then link the minimal app with the lib and sqlite3.lib. Works perfectly here.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

arno03
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Feb 24, 2005 4:50 pm
Location: Paris
Contact:

Post by arno03 » Mon Aug 22, 2005 1:29 pm

i follow your instructions and now, i received:

minimal.cpp: In function `int main(int, char**)':
minimal.cpp:238: warning: comparison between signed and unsigned integer expressions

minimal.cpp:258: warning: comparison between signed and unsigned integer expressions

minimal.cpp:298: error: `e' undeclared (first use this function)
minimal.cpp:298: error: (Each undeclared identifier is reported only once for each function it appears in.)
ArNo

ssigala
Earned some good credits
Earned some good credits
Posts: 109
Joined: Fri Sep 03, 2004 9:30 am
Location: Brescia, Italy

Post by ssigala » Mon Aug 22, 2005 1:31 pm

arno03 wrote: After I try to compil minimal.cpp but i receive somes errors :
http://lmdf.free.fr/log.txt

Code: Select all

... -lwsock32 -lodbc32 -lopengl32 -sqlite3.lib ...
                                  ^
                                  | typo here
Sandro Sigala - Kynosoft, Brescia

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Mon Aug 22, 2005 1:36 pm

-lwsock32 -lodbc32 -lopengl32 -sqlite3.lib
should read
-lwsock32 -lodbc32 -lopengl32 -lsqlite3

You added the lib path to your project settings, right?
Just ignore the warnings, they won't do harm...

The error might be comming from the exeption handling. Did you compile the lib and the app to support execptions?? If not -> delete the whole try{}catch() block. Note that don't recommend this, as exceptions are usefull.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

arno03
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Feb 24, 2005 4:50 pm
Location: Paris
Contact:

Post by arno03 » Mon Aug 22, 2005 8:28 pm

the Static Lib, Projet1.a is in C:/DevCpp/lib/
Image

http://lmdf.free.fr/log2.txt
ArNo

ssigala
Earned some good credits
Earned some good credits
Posts: 109
Joined: Fri Sep 03, 2004 9:30 am
Location: Brescia, Italy

Post by ssigala » Mon Aug 22, 2005 9:02 pm

If you want to link against a certain lib called "libfoo.a", you should specify "-lfoo" as parameter.

In your screenshot, you specify "-Projet1" witch is wrong.

First of all, rename the library from "Projet1.a" to "libProjet1.a"

Then specify "-lProjet1" instead of "-Projet1".
Sandro Sigala - Kynosoft, Brescia

arno03
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Feb 24, 2005 4:50 pm
Location: Paris
Contact:

Post by arno03 » Mon Aug 22, 2005 9:12 pm

ow ok, thx ssigala :) its progressing!

http://lmdf.free.fr/log3.txt
ArNo

Post Reply