Board index » delphi » Tquery edit mode problem

Tquery edit mode problem

Hi all,

I was just wandering how I can force my TQuery (complete with working SQL)
to .edit mode ??

Its always saying its a readonly dataset, but Id like to know if there is
anyway to overcome this readonly problem..

Thanks all
Mick

 

Re:Tquery edit mode problem


A query is a COPY of the database/databases (or parts of it).
So it does not make much sense to change it.
What are you trying to accomplish?
Perhaps we can sugest a better way.

Mick Jagger skrev i meddelelsen
<7dsuks$4n...@reader1.reader.news.ozemail.net>...

Quote
>I was just wandering how I can force my TQuery (complete with working SQL)
>to .edit mode ??
>Its always saying its a readonly dataset, but Id like to know if there is
>anyway to overcome this readonly problem..

Re:Tquery edit mode problem


Mick,

You can only put a query into edit mode if RequestLive = True. And you
can only set RequestLive to True if the query conforms to the syntax
requirements for a live result set, which will depend on what database
engine you are using.

To find out whether your query will return a live result set, test its
CanModify property.

--
Stephen Brown

Quote
Mick Jagger wrote in message

<7dsuks$4n...@reader1.reader.news.ozemail.net>...
Quote
>I was just wandering how I can force my TQuery (complete with working
SQL)
>to .edit mode ??

>Its always saying its a readonly dataset, but Id like to know if
there is
>anyway to overcome this readonly problem..

Re:Tquery edit mode problem


Quote
>Hi all,

>I was just wandering how I can force my TQuery (complete with working SQL)
>to .edit mode ??

>Its always saying its a readonly dataset, but Id like to know if there is
>anyway to overcome this readonly problem..

>Thanks all
>Mick

Make sure you set the TQuery's requestlive property to true.  If you are using
a join then you need to hook up a UpdateSql object to the TQuery to get a
editable result set.

HTH
********************************
Michael Glatz              
glatzfa...@aol.com
mgl...@briefcase.com
There are very few personal problems that cannot be solved through a suitable
application of high explosives.

Re:Tquery edit mode problem


Hi Finn,

Quote
> >I was just wandering how I can force my TQuery (complete with working SQL)
> >to .edit mode ??
> A query is a COPY of the database/databases (or parts of it).
> So it does not make much sense to change it.

With all due respect, that's nonsense. A query is a CURSOR on a dataset,
and can perfectly be used to edit, insert or delete data. As a matter of
fact, I hardly ever use TTables, but mostly TQueries, and I can edit the
data within the query's cursor without any problem. Just make sure that
RequestLive is set to True before you open the query.
OK, for batch update, insert or delete jobs I use another query or
stored proc, but most simple alterations can be handled within the
current select query just fine.

Quote
> What are you trying to accomplish?
> Perhaps we can sugest a better way.

If there is a better way, I would be very interested...

Regards,
Erik

Re:Tquery edit mode problem


.ReqestLive - no warranty

.CachedUpdates + TUpdateSQL

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...Should we shout ? Should we Scream ?    ...With all the best wishes - Arioch /BDV/
   What happenned to the post-War dream ?     Buroff - the only and unique...

Other Threads