Database controls 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.
Post Reply
Holms
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Aug 14, 2006 7:12 am

Database controls

Post by Holms » Mon Aug 14, 2006 7:35 am

Hello

I'm going to port on of my Delphi application on wxWidgets and wondering if there are any DB controls already written in wxWidgets, like DBGrid, DBEdit and so on...
If not, will need to write my own :(
Any advices would be nice
Thx
P.S. For those which don't know about Delphi and its DB controls.
DBGrid - binded to a datasource handles automacatically the displaying of data from a SQL query, allowing editing/deleting the current records.
DBEdit - same as DBGrid only works for a field from recordset.

gururamnath
Moderator
Moderator
Posts: 466
Joined: Sat Sep 18, 2004 2:49 am
Location: California, USA

Re: Database controls

Post by gururamnath » Mon Aug 14, 2006 8:39 am

You have some controls for wx's Database implementation (which supports only ODBC) (you also have an outdated 3rd party control called wxOTL - http://home.tiscali.be/t.bogaert/wxOTL/ ). If you want to do some native db implementation and want to have data binding control, then you are out of luck. There are very few native db implementations available for wx (databaselayer is a popular one ) but it doesnt have any dbcontrols. I started converting my own delphi programs to wx almost a year back and I directly use database layer (with some home grown persistent layer).
I have also added some easy variable to control assignment feature in the wx-devcpp (which is also written with delphi). Try downloading the latest alpha and see for your self.

-Guru Kathiresan

Peterj
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Nov 14, 2005 6:48 pm
Location: Australia

Post by Peterj » Mon Aug 14, 2006 10:36 am

I have also added some easy variable to control assignment feature in the wx-devcpp
Hi Guru,

Could you describe what you mean here in a bit more detail please.

Regards,
Peter
Using Win XP, Dev C++ 4.9.9.2 wx-beta 6.9

phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 » Mon Aug 14, 2006 11:02 am

There is a C++ Lib called DTL (Database Template Library).
It has a pretty handy design, and if you're used to work with stl,
its really easy to use.

But afaik there are no controls that use DTL. wxODBC can be
used with wxDBGrid, but I actually never had to access
a DB in one of my wx-programms, so I have no expierence in that.

Holms
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Aug 14, 2006 7:12 am

Post by Holms » Mon Aug 14, 2006 6:07 pm

Eh, the situation seems to be complicated :( cause my app use a lot of binding by saving me a lot of time.
I guess I'll have to derive from standard controls and bind them to database, guess will wxODBC for this.
Thx for confirmation that there are no such controls, needed to make sure about this before starting writing my own.

gururamnath
Moderator
Moderator
Posts: 466
Joined: Sat Sep 18, 2004 2:49 am
Location: California, USA

Post by gururamnath » Mon Aug 14, 2006 6:23 pm

Peterj wrote: Could you describe what you mean here in a bit more detail please.
Hi Peter,
This is a new feature for 6.10 beta (which will be released by the end of next month). I have added 2 properties: LH Variable and RH Variable in most of the user editable controls. If you assign a LH variable to a edit control, the IDE will automatically generate something like

m_strFirstName = txtFirstName->GetValue();

and for the RH Variable

txtFirstName->SetValue(m_strFirstName);

The are some complex syntax you can use with the LH and RH Variable to assign function calls, specify Combobox Selected Item etc. If you need the new template, please send an PM to me.

Thanks,
Guru

gururamnath
Moderator
Moderator
Posts: 466
Joined: Sat Sep 18, 2004 2:49 am
Location: California, USA

Post by gururamnath » Mon Aug 14, 2006 11:19 pm

After some search I found there is one set dbcontrols for wxSqlite3.
Check http://www.dynaset.org/dogusanh/download.html#dbadapter for details.

-Guru Kathiresan

Holms
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Aug 14, 2006 7:12 am

Post by Holms » Tue Aug 15, 2006 6:26 am

Hi Guru

Those classes seems to help me a lot.
Thx

Post Reply