MSHflexgrid doesnt update after adodc changes databse HELP!

MSHflexgrid doesnt update after adodc changes databse HELP!

Post by Lifete » Tue, 26 Nov 2002 04:57:41



I have a MSHFlexgrid and a ADODC component in my program. When i change the
values in the database with the ADODC component, the MSHflexgrid component
doesnt give me the new database data on the screen. I have tried to refresh
both the adodc recordset and the flexgrid control. Then the flexgrid
controls doesnt show all the changed data. I checked the database and the
changes are realy made by the adodc. Can somebody help me, PLEASE!! I have
looked everywhere but i can't find the solution. THank you very much!

Bas van Dorenmalen

 
 
 

1. MSHflexgrid doesnt update after adodc changes databse HELP!

Hi,

Create the same dataenvironment twice. Let's name them dte1 and dte2.
The flexgrid we call grd - bound to the dte1 at design time
After you updated the ADO-recordset, you switch the datasource for the
grid from one dataenvironment to the other

Private sub Form_Load()
if dte1.connection1.state = adClose then
  dte1.connection1.open
end if

if dte1.command1.state = adClose then
 dte1.command1.open
end if

' the same you do for dte2

dteString = "dte1"

End sub

' here comes the procedure to call at updating your recordset

Private sub doUpdateRecordset()

'do your thing with the fields of the recordset
adodc1.recordset.update

'to make sure
adodc1.recordset.requery

'and now.....!!!!1

set grd.datasource = Nothing
grd.datamember = "command1"

if dteString = "dte1" then
 set grd.datasource=dte2
 dteString = "dte2"
else
 set grd.datasource=dte1
 dteString="dte1"
end if

End sub

--
Posted via http://dbforums.com

2. In article 5tv@nimno.wpa.com, john@wpa.com (John Bartley) writes:

3. ADODC and MSHFlexgrid update

4. Oracle Openquery Hanging

5. help with adodc and mshflexgrid

6. MSoft works database to dBase/Clipper converter

7. Help with ADODC and MSHFlexGrid

8. MSHFlexgrid not updating when recordset changes

9. ADOdc doesnt save ConnectionString?

10. problem with ADODC command & MshFlexgrid

11. Problem: simple Adodc-MSHFlexGrid connection dropping records

12. ADODC and MSHFlexGrid in a MFC app?