Board index » delphi » readonly result set / refresh problem
michael peirc
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
michael peirc
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
readonly result set / refresh problem
We have a browse (grid) that gets its sql statement optionally from a
query tool. Hence we cannot be sure if it will receive a live result set. This grid doubleclicks to open a form for editing. If we edit the form, we need to be able to update the data in the grid without opening / closing the query (too slow). But 'refresh', invalidate etc don't do this. Any ideas? cordially |
Glen Meredit
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemmichael, I had to something similar for a client. It's been a while. If I recall I "shared" the data between the two forms. Just let the edit form "use unit" of the grid form. It will then be able to access all objects - including tables. then when changes are made on the edit form, then saved they s/b automatically reflected in your grid. Make sure your edit form is created after your grid form. The only problem is - you must editform.ShowModal. In my case that wasn't a problem. Help? Quotemichael peirce wrote: |
Fabi
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemQuotemichael peirce wrote: |
michael peirc
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemFabio We have a grid form / edit form as a master detail. They work off a query. thanks QuoteFabio wrote: |
Team
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemTQuery does not support the Refresh method. You have to open/close. Juan Quotemichael peirce wrote: |
michael peirc
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemJuan Yeah, we know. But it's very slow so we've been looking hard for a work around. cordially QuoteJuan Jimenez (TeamB) wrote: |
Didzis Klavin
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemYou can speed it up if you 1. double check the design of your query so that it is executed faster 2. redesign it (or a whole data model) so that it returns a smaller result set. Or teach your customers to group data in smaller portions so your detail count becomes smaller 3. Crazy idea but might work: RequestLive:=False; Then simply edit the row after returning from edit dialog for that particular row. HTH Didzis Quotemichael peirce wrote: |
Team
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemWell, this is the kind of problem that usually benefits from giving the query's SQL statement and the selection requirements some careful thought. Have you thought about the possibility of refining the query to return a smaller return set and enhance the performance? Also, give some thoughts to indexes, if you have a query and are requesting an order by using fields that are not in an index, the query will be slower than if you make the order by components into an index. Juan Quotemichael peirce wrote: |
michael peirc
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemDidzis You should come work here! Those were the paths we've been runninng down today. Three cheers for the bde. NOT Thanks for the help - those were all good ideas. cordially QuoteDidzis Klavins wrote: |
Fabi
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:readonly result set / refresh problemQuotemichael peirce wrote: SQL and I don't think there is a faster way to do this in Delphi than using a TQuery Close/Open pair. If performance is poor I believe that your data structure on the server should be tuned. Regards, Fabio |
1. Updating ReadOnly Result Sets w/ MSACCESS
2. Q: Does setting Table.ReadOnly := False set the current record pointer to BOF
3. DBNavigator Refresh and ReadOnly table
4. problems returning live result set from query
5. TADOStoredProc w/result set, clUseServer problem
6. Delphi with Oracle - Case Sensitivity Problem with Live Result Set
7. Problem with output parameters and result set
8. Problems while opening a query with empty result set (Sybase)