I'm having trouble with sql. I have created a querie from tree tables
(paradox) and between certain dates.
This worked fine and I placed the the result in a dbgrid. Now I want to
check a field in this querie result and depending on the value I want to
fill in a value in this sql result. This doesn't work, I always get the
message 'can not modify a read-only table'
Does anyone know what I'm doing wrong.
TNX
Stijn
Sti...@Stijn.be
Stijn.Van...@advalvas.be
Dirk Kleist (D.Kl...@img-tech.de)
Stijn Vanderfeesten <Sti...@Stijn.be> schrieb in im Newsbeitrag:
81dg66$smo$1...@nickel.uunet.be...
>I'm having trouble with sql. I have created a querie from tree tables
>(paradox) and between certain dates.
>This worked fine and I placed the the result in a dbgrid. Now I want to
>check a field in this querie result and depending on the value I want to
>fill in a value in this sql result. This doesn't work, I always get the
>message 'can not modify a read-only table'
>Does anyone know what I'm doing wrong.
Multi-table local SQL queries will nearly always be read-only. You cannot
use editing methods of TQuery (like Edit and Insert) on such read-only
queries.
One way you can handle this situation is to enable cached updates and use
an update object (like TUpdateSQL) to apply cached updates to the base
tables. This approach gives the appearance and functionality of an editable
query result set in a grid -- even for a multi-table query.
Another approach (Client/server edition and above) is to operate on the
data via a TClientDataSet component. Conceptually, this is like using
cached updates. But the caching and applying updates is all contained in
the ope component. And TClientDataSet is programmed to do a better job of
it.
And still another approach would be to use a separate TQuery to update the
tables. Use the TDBGrid to select the record to update. Use non-data-aware
controls in a dialog to enter the data. Then use those values in an UPDATE
or INSERT statement executed from a TQuery other than the one used to
retrieve the original result set.
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski "Health nuts are going to feel stupid someday,
Felton, CA lying in hospitals dying of nothing."
-- Redd Foxx
IMHO, you must set RequestLive to true.
Ciao Dirk.