Board index » delphi » TQuery + DBGrid how to edit fields?

TQuery + DBGrid how to edit fields?

Hi,

I've encountered this problem:
When I want to edit something in a DBGrid that is linked to TQuery, I can't?
Why?
- it works perfect when the DBGrid is linked with a TTable?

How can I solve this problem? - should I use a new component instead of
DBGrid?
- I need to edit the fields of a SQL query result! not the hole table!

Thanks in advance,

krzy...@interia.pl

 

Re:TQuery + DBGrid how to edit fields?


"krzyber" <krzy...@interia.pl> wrote in news:3ba91024_2@dnews:

Quote
> Hi,

> I've encountered this problem:
> When I want to edit something in a DBGrid that is linked to TQuery, I
> can't? Why?
> - it works perfect when the DBGrid is linked with a TTable?

> How can I solve this problem? - should I use a new component instead of
> DBGrid?
> - I need to edit the fields of a SQL query result! not the hole table!

> Thanks in advance,

> krzy...@interia.pl

You need to use a TUpdateSQL with the TQuery. If you do it through the IDE,
Delphi will create the SQL for you...

--
Jacob Pedersen
AK Techotel
J.Peder...@nospamtechotel.dk
(Remove nospam when replying!)

Re:TQuery + DBGrid how to edit fields?


Or, you can set RequestLive to True, depending on the SQL.

John Pierce

Other Threads