Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When is an ADODC control populated?

Status
Not open for further replies.

custsoft

Programmer
Aug 29, 2000
41
I am using ADO 2.1 in VB6 and an ACCESS 2000 database. I have three ADODC's on one form each connected to the database in different sequences. The ADODC's are connected to datagrids. If I disable the ADODC control will it still be populated and therefore the datagrid when the form is loaded? The user can only choose one sequence to look at at a time so I don't want the other ADODC's or datagrids to be populated unless needed. Can I stop the ADODC/datagrid from being populated? Thanks for any help.
 
I'm not sure if I'm getting what you want, but wouldn't this work?

adodc1.Recordsource=""
adodc1.Refresh

This would clear all the datagrids connected to this ado control, was this what you were asking?
 
That might accomplish what I want. Basically I want to make sure the datagrids are not populated. So I should not set the recordsource in the control but set it in code. If it is set in the code then I assume it must be populating even if the ADODC is disabled. Thanks for your help.
 
you're welcome, if that's just what you need then the above code will work fine :)
 
I messed with the recordsource property but the problem is that I want to avoid the ADODC's from populating on the screen load. If I set the recordsource property to either blank or "", in the control, I get an error message when I execute the program. There are three ADODC's on the form but I only execute one at a time depending on what option button they choose. Maybe I need to make a seperate form for each option because the enable doesn't seem to affect whether the ADODC is loaded or not.????
 
the problem should be that you have controols bound to the Adodc right?

So just bound/unbound them to the adodc control by code and when you need instead of doing it at design time.
At design time don't bound them to the adodc control(except the ones you need everytime).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top