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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update database, ADO, Datagrid?

Status
Not open for further replies.

custsoft

Programmer
Aug 29, 2000
41
I am using an Access 2000 database, ADO 2.1 in VB 6.0. I have an ADODC control hooked to a datagrid. When they select a record and change something I use the adodc.recordset.movenext and that should update the Access 2000 physical file right? I am basically confused on what updates what. What is the correct way to update the datagrid, recordset, etc? I have been using the refresh method but that does take a lot of time. How do I get the changes to the datagrid? It seems like the requery and resysnc don't work. Thanks for your help.
 
Try the UpdateControls Method check it out in MSDN. Sounds like it will do what you want.

Hope this helps

Pete Hope this helps,

Pete
_____________
Real programs don't eat cache


 
Custsoft -

To get the datagrid to reflect your changes.... just do:

Adodc1.Refresh

the Refresh method will re-populate your grid.

Hope this helps you.

John
 
As soon as the user tabs to another column or another row in a bound data grid, the underlying recordset is updated.
Unless this is a closed recordset, the database itsself should reflect the change. The Adodc1.Recordset object exposes an Update method, or you can MoveNext or MovePrevious to update. As far as I know, either update method works fine, but I've seen where .Update can be shaky on a slower network connection. The Refresh method reconnects the Ado to the database, so it won't necessarily reflect the update if the database itsself didn't receive the change (if the user changes data in a column and refreshes without tabbing to the next field or record). Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top