Board index » delphi » Problem with TQuery ---> TDataset

Problem with TQuery ---> TDataset

Hi all,
On the Form I have two TQuery objects which are connected with the same
PARADOX table. With one of them I do readings and with the other changes
and addings of the new records. But when I try to do this, compiler
suggests me this message: TDataset is Read-Only. When I use TTable instead
of TQuery everything works perfectly. But, I must use TQuery because of the
structure of the project. What should I do, so I'll be able to do changes
and addings in the PARADOX table trought TQuery object or how should I
change state of Dataset trought TQuery.

Can I read and record data in the same time with one TQuery object, can I
duplicate whole record ??? I ask this because I have 17 fields in one
record, and I should do the changes only in one field. I think that it is
much easier to duplicate that whole record, and then change that particular
field.

Of course, all the suggestions what should I do to solve this problems are
wery well welcomed.

Thanks a lot.
--
===========================================
   Dusko Jovic
     My real e-mail: d...@EUnet.yu
       Homepage: http://solair.eunet.yu/~dux
===========================================
     >>> Please remove NOSPAM to reply <<<
===========================================

 

Re:Problem with TQuery ---> TDataset


Hi Dusko,
The problem is a SQL clause, by example ORDER, GROUP BY, ... with this
clauses you don't insert and update the dataset returned by the BDE...
Sorry, i  can explain ... i don't repair this
But , in my app, i add a button with 2 states :
    Sorting by...
    Update & Insert
If the state is 'Sort' i add a SQL param
    TQUERY.SQL.ADD ('ORDER BY  DATE_UPDATE')
    Also, the tQuery.RequestLive = false (no update)
If the state is 'Update..'
    TQUERY.SQL.CLEAR
    TQUERY.SQL.ADD ('SELECT * FROM ...)
    TQUERY.SQL.ADD ('WHERE...')
    Also, the request is alive...update is possible...

Good job ...
Reynald Valle

Dusko Jovic a crit dans le message <01bd0196$4876a860$LocalHost@default>...

Quote
>Hi all,
>On the Form I have two TQuery objects which are connected with the same
>PARADOX table. With one of them I do readings and with the other changes
>and addings of the new records. But when I try to do this, compiler
>suggests me this message: TDataset is Read-Only. When I use TTable instead
>of TQuery everything works perfectly. But, I must use TQuery because of the
>structure of the project. What should I do, so I'll be able to do changes
>and addings in the PARADOX table trought TQuery object or how should I
>change state of Dataset trought TQuery.

>Can I read and record data in the same time with one TQuery object, can I
>duplicate whole record ??? I ask this because I have 17 fields in one
>record, and I should do the changes only in one field. I think that it is
>much easier to duplicate that whole record, and then change that particular
>field.

>Of course, all the suggestions what should I do to solve this problems are
>wery well welcomed.

>Thanks a lot.
>--
>===========================================
>   Dusko Jovic
>     My real e-mail: d...@EUnet.yu
>       Homepage: http://solair.eunet.yu/~dux
>===========================================
>     >>> Please remove NOSPAM to reply <<<
>===========================================

Other Threads