Client/Server and Updates on TQuerys 
Author Message
 Client/Server and Updates on TQuerys

May be this is a familiar and old problem to many of you. When you insert a
record in a TQuery component, that is linked to a Client/Server database
like Interbase, you may notice that after you call the Post method, the
recordset seems to be missing a record. Trying to call the refresh method
ends up in an exception. All that I know I can do is call the close method,
followed by the Open method. The new problem now is that your table cursor
is set to the first record in the Query. If I want to jump to the
previously entered record, I could use the Locate method, BUT this is for
sure not the best solution because not the aim of a Client/Server database
where these requests should run on the Server and not on the client (Locate
is completely executed on the client, the whoel dataset is sent over the
network).

Does anyone have a better solution than Locating the data on the client?
--

----------------------------------------------------------------
Tom Peiffer

Webpage: http://www.*-*-*.com/ ~peiffer
(Contains my delphi Components)
----------------------------------------------------------------



Thu, 26 Apr 2001 03:00:00 GMT  
 Client/Server and Updates on TQuerys
Tom,

DON"T USE LIVE QUERIES TO AN SQL-DATABASE.. YOU ARE LOCKING PAGES...

Instead, Use a Select Query for Selects, and inserts, deletes, updates for
the rest..

Also, a post method does not rollback transactions... Dangerous..

If you use Database.Commit it should refresh your changes to your database
and reflect them back to you.
If you need a live connect for TDbGrids, etc, use a TClientDataSet which is
an in memory table. It also has a delta change that will automagically
thread your changes to your database server. The only problem with
TCleintDataset using cached updatesis that the user may not see the refreshd
data until after ApplyUpdates have been committed.


Quote:

>May be this is a familiar and old problem to many of you. When you insert a
>record in a TQuery component, that is linked to a Client/Server database
>like Interbase, you may notice that after you call the Post method, the
>recordset seems to be missing a record. Trying to call the refresh method
>ends up in an exception. All that I know I can do is call the close method,
>followed by the Open method. The new problem now is that your table cursor
>is set to the first record in the Query. If I want to jump to the
>previously entered record, I could use the Locate method, BUT this is for
>sure not the best solution because not the aim of a Client/Server database
>where these requests should run on the Server and not on the client (Locate
>is completely executed on the client, the whoel dataset is sent over the
>network).

>Does anyone have a better solution than Locating the data on the client?
>--

>----------------------------------------------------------------
>Tom Peiffer

>Webpage: http://www.rhrk.uni-kl.de/~peiffer
>(Contains my Delphi Components)
>----------------------------------------------------------------



Fri, 27 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Client/Server update errors!

2. Client/Server Update Errors!

3. CLIENT - SERVER (How many clients?)

4. Client - Server "How many clients?"

5. DELPHI 16 to SYBASE on an NT Server with client and server on same machine

6. Client DataSets + Apply Updates

7. PROBLEM: Re Client Data Sets + Updating

8. Automatic update of multiple clients

9. Any TCP/IP client/server tutorial for Delphi

10. Suggestions for Client/Server database

11. Q: Delphi 1.0 Client/Server and multirow fetching from Oracle 7.3 Stored Procedures

12. Client / Server database

 

 
Powered by phpBB® Forum Software