Updating a remote MySQL DB from client DBGrid

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Bryan
Posts: 13
Joined: Fri 09 Feb 2007 16:02

Updating a remote MySQL DB from client DBGrid

Post by Bryan » Sat 01 Dec 2007 14:57

Hello all,

I'm new to MySQL and MyDac.
I have successfully been able to connect to my remote MySQL DB and run a query and populate a DB Grid on my test client app.

My question is does anyone have an example on how to change the data in the DB Grid, then have those changes post back to the remote MySQL DB?

I'm sure it would be done with SQL update command, but how do I get that from the DB Grid.

A quick example or advise would be greatly appreciated.

Thanks!
Bryan

Bryan
Posts: 13
Joined: Fri 09 Feb 2007 16:02

Post by Bryan » Sat 01 Dec 2007 15:20

Never mind...

I see that this is done automatically when I change the data in the DB Grid.

On the other hand, is there anything I need to worry about when doing this?

Thanks!
Bryan

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 03 Dec 2007 13:53

You can also use the TDBNavigator component with TDBGrid. It simplifies data editing. You will find this component at the Data Controls tab of the Palette.
You can also setup queries to be performed when editing data by yourself. This may be necessary for complicated SELECT queries, and for more flexible management of data editing. For more information please see the UpdateSQL demo of MyDAC, and read description of the TMyUpdateSQL component in the MyDAC help.

Post Reply