ADODC1 and TDBGRID Refresh Problems

CarlH
04-20-2004, 02:34 AM
Hi,

I have an app with ADO data control linked to an Access database MDB.
I also use a TrueGrid 6 (OLE) control bound to the ADO control.

For some reason, the Grid does not populate correctly.

i.e. I have two ADODC controls and two TDBGRID controls.
Click on the one TrueGrid and select an item, then the second adodc control is passed a SQL statement relevant to the selected item in the first TrueGrid and populates the second Truegrid.

The problem is that you can click on one item, it fills the second truegrid with a further selection, click on another item in the first truegrid and nothing happens, click it again and then it populates.

Obviously I only want to click the item once and get the selection.

I think it may have something to do with how quick ADO and the access-driver refreshes the recordset because the code clears a temporary table, populates it with the selected data and I think between deleting the data and then re-populating it, the ADO data control gets ahead of itself and does not wait for the MDB to populate itself (it this makes sense).

I've tried refreshes, doevents, closing and re-binding but the effect is the same - I have to select an item twice before it refreshes the second truegrid.

Anybody else have that problem or know of a ADO trick to wait until the MDB is finished with populating?


Carl.

Shurik12
04-20-2004, 02:43 AM
Hi,

I'm afraid I have not used the TrueGrid control, still more then sure you'll be better off (without "refreshes, doevents, closing and re-binding...") if you just open your connection and recordset in code (see the FAQ section for tutorials if neccessary) and thus avoid using ADODC which is well known for the weird behaviour from time to time.


Shurik.

pkeram
09-04-2004, 07:14 AM
Hi,

I have an app with ADO data control linked to an Access database MDB.
I also use a TrueGrid 6 (OLE) control UNBOUND to the ADO control.

For some reason, the Grid does not populate correctly.

i.e. I have two Rrecordset with ADO 2.6 and two TDBGRID controls.
Click on the one TrueGrid and select an item, then the second Rrecordset control is passed a SQL statement relevant to the selected item in the first TrueGrid and populates the second Truegrid.

The problem is that you can click on one item, it fills the second truegrid with a further selection, click on another item in the first truegrid and nothing happens, click it again and then it populates.

Obviously I only want to click the item once and get the selection.

I think it may have something to do with how quick ADO and the access-driver refreshes the recordset because the code clears a temporary table, populates it with the selected data and I think between deleting the data and then re-populating it, the RECORDSETS gets ahead of itself and does not wait for the MDB to populate itself (it this makes sense).

I've tried refreshes, doevents, closing and re-binding but the effect is the same - I have to select an item twice before it refreshes the second truegrid.

Anybody else have that problem or know of a ADO trick to wait until the MDB is finished with populating?


PKERAM

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum