|
-
Jul 19th, 2005, 03:16 AM
#1
Thread Starter
Junior Member
ADODC/DataGrid Issue
I have two datagrids on a form, each using their own adodc control.
In the _AfterColUpdate event handler on the first datagrid, that cell's information is used to update a row or two in the table behind the 2nd datagrid (via .execute sql on the connection). Using .refresh on the second adodc and datagrid has no affect with respect to the newly changed data until after the thread producing that change has terminated. (E.g., after a breakpoint has broken the flow on that thread, or running the .refresh statments from a command button after the thread is terminated.)
This is a "generic" problem I have had often in similar situations that involves use of bound controls and programmtic modification of DB tables. (DoEvents has no effect in these situations.)
Is there an event further in the flow of such in which the .refresh commands on the second datagrid would have an effect?
Is there some other way of implementing the refresh?
(Hopefully, something better than putting the .refresh code in something driven by a timer. [Argh! Perverse, late-night thoughts.])
I have experienced so many variants of this issue through the years, it would be really nice to find an elegant resolution. Also, it would be really helpful to find a good description of the underlying processes involved, and what one can do to keep things better synchronized between the database and the controls.
Thanks, in advance
Jim
-
Jul 19th, 2005, 03:28 AM
#2
Re: ADODC/DataGrid Issue
Try using adUseClient as your CursorLocations... After refreshing the Adodc are you using this?
Last edited by dee-u; Jul 19th, 2005 at 03:31 AM.
-
Jul 23rd, 2005, 08:38 PM
#3
Thread Starter
Junior Member
Re: ADODC/DataGrid Issue
Thanks Dee-U.
I had long ago played around with Server cursorlocation, and found one place that I had not restored to client. Neither that nor the rebind helped. I had earlier put in a half second delay (using a timer) to terminate the thread before doing a refresh. That did not help. It seems that client action is needed. (I had earlier put a refresh button on the form -- that always works.)
After making the change to the first grid that programatically changes the data in the second grid, with no change iseen in the second grid, if I then make a benign change to the first grid, the second grid shows the change it should have earlier. It seems that some kind of user action is required.
In wondering if there is something that needs to be done at the level at which the change to the first grid was done (.execute sql on the connection), I noticed the Begin and End transaction commands. (Likely candidate for a fix.) That worked! Voila!
Your suggestions were worthwhile.
And, they sparked me in the right direction.
Thanks.
Jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|