db question

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Goretz
Posts: 10
Joined: Mon 07 Aug 2006 10:26
Contact:

db question

Post by Goretz » Wed 09 Aug 2006 10:06

I have one question. Can i use dbgrid to insert data without using the navigator? the dbgrid will not be displaying any data but only for inserting. Thanks :?:

Zagawa
Posts: 21
Joined: Fri 12 May 2006 09:56

Post by Zagawa » Wed 09 Aug 2006 13:31

Hi,

Use Query in your TMyQuery like :

Code: Select all

Select * from MyTable where false
Now you always have an empty dbGrid at startup, and you can insert record.

Goretz
Posts: 10
Joined: Mon 07 Aug 2006 10:26
Contact:

how to specify column in dbgrid?

Post by Goretz » Thu 10 Aug 2006 01:55

thanks it works! one more question, how do i insert the values from dbgrid to mysql? how to capture input from a specific column? Thanks

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Fri 11 Aug 2006 09:03

Try to use TCustomDADataSet.BeforeUpdateExecute event.

Post Reply