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

How do I refresh a data grid that is populated by an ADO datasource?

Status
Not open for further replies.

jessicabailey

Programmer
Jul 24, 2003
14
US
I have searched high and low and have been unable to find a resolution to my problem, I'm hoping that someone out there has been through this and might be able to help me.

I have created a VB app with a data grid that is populated by an ADO recordsource. I have a field, ADJ_COST, that is keyed by the user and another field, ADJGM% that is calculated based on the entry in the ADJ_COST field.

My problem is after the entries are made into a multi-row grid, and the grid after update event runs my app freezes and I have to completely close it and go back in.

I'm new to this so maybe I'm not putting my update procedure in the correct place...but I'm lost and need a little help. I've had my resident VB Gurus look at the problem and they can't seem to help...so I'm hoping someone out there can.

Help Please?!
Jess
 
I'm updating the records with an SQL update. I have found I can call the SQL in the grid after update and can update one row of my grid with no problem.

The problem seems to be occurring when I try to update multiple rows in a data grid. I'm sure it is possible to update multiple rows in a grid, but when I try my app locks up after updating the first row.

Any suggestions?
 
1. Make sure you have updated you VB6 to SP5 (download from the MS Site - downloads)

2. Use a Client side cursor!

3. If you are using action queries to update the DB table anyways, then disconnect the recordset:

Set rs.ActiveConnection = Nothing

4. Try using the recordset's events by declaring the recordset in the declarations section of the code module using the keyword WithEvents and then add the RecordChangeComplete event (in the code window's left Object dropdown select the recordset object name and in the right window select the RecordChangeComplete event and execute your statement there.

These will update each changed record when it gets updated to the recordset.

You can also do Batch updates, but you will have to deal with multi-user conflicts differently.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top