Delphi 2005 Standard "Data controls"

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
steveastrouk
Posts: 6
Joined: Sun 29 Jan 2006 23:47

Delphi 2005 Standard "Data controls"

Post by steveastrouk » Thu 02 Feb 2006 21:47

Whilst I have, thanks to Pieter, begun to get my SQL app working - adding science results from equipment readings at 100 inserts/second, I cannot understand how the standard delphi datacontrols like Tdbmemo and Tdbedit can work with MySQL and without BDE or whatever.
Specifically, I want to create a table containing sample reference data for the science data, which I assume means I will have a master-detail setyp,

Suppose I have a form setup like a browse window, with several separate DBedit, memo components, assigned to the correct datasets

I can fill in data in each component, but isn't that data automatically inserted into the database, so for every data control component I edit I will create a new record in the table, when what I want to do is to take all the data at the same time and write into a single record with a Tmycommand SQL statement ?

Before anyone says "buy a book" I have just spent 100 GBP on MySQL tutorial (MySQL), MySQL cookbook (O'Reilly) and Understanding Delphi2005 (Marco Cantu, Sybex)- All excelllent books, but MySQL DACs clever avoidance of the standard Delphi DB interface makes it hard to see how to transfer to this method of doing things.
Thanks again for your input.

Steve

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Thu 02 Feb 2006 22:23

Well I don't know where you're wrong, but myDac components behave just the same as BDE's TTable/TQuery. Just connect the TMyQuery/TMyTable to a TDataSource, and this one to the DBEdit's, DBMemos, and when you enter anything it will be editing the current record (Or if empty, add a record).

steveastrouk
Posts: 6
Joined: Sun 29 Jan 2006 23:47

Post by steveastrouk » Thu 02 Feb 2006 22:46

GEswin wrote:Well I don't know where you're wrong, but myDac components behave just the same as BDE's TTable/TQuery. Just connect the TMyQuery/TMyTable to a TDataSource, and this one to the DBEdit's, DBMemos, and when you enter anything it will be editing the current record (Or if empty, add a record).
Hi Again Pieter,

Now I have it. I have to explicitly call the table.insert or table.update methods with some other function, like clicking on a button ?

Thanks
Steve

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Fri 03 Feb 2006 10:29

No, you don't need to call neither update/insert. If table is empty, when you start to type on a DBEdit , it inserts a record automatic. If table is not empty, then you can add a record with Insert or Append function.

Make sure you set on DBEdit the DataSource & Field properties correctly.

steveastrouk
Posts: 6
Joined: Sun 29 Jan 2006 23:47

Post by steveastrouk » Fri 03 Feb 2006 18:44

GEswin wrote:No, you don't need to call neither update/insert. If table is empty, when you start to type on a DBEdit , it inserts a record automatic.
Hi Pieter,
This it definitely didn't do, I had "Autoedit" set though, and I thought that means it will add to a blank table.
Thanks
Steve

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Fri 03 Feb 2006 22:27

Hi Steve, sorry but my english is not that good, i didn't understand your last message:
This it definitely didn't do, I had "Autoedit" set though, and I thought that means it will add to a blank table.
Does it mean you got it working after setting AutoEdit to True (As it is by default) ?

Regards

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 06 Feb 2006 12:06

Please see MyDAC demos. If you find any bugs in them, send us their descriptions.

Post Reply