Requery Data Source Object based on ADO Recordset 
Author Message
 Requery Data Source Object based on ADO Recordset

Hi every one,

I build an data source class to fill a ADO Data List.  For some reasons, the
data behond the list could change but the list wont update (of course).

The problem is that when a make a requery of the object private recordset
var, i get "Object was open" error. Here is the code of my object.

Could some one help me ??
Thanks.

Option Explicit

Private rsFileMaterials As ADODB.Recordset

Private Sub Class_GetDataMember(DataMember As String, Data As Object)
On Error GoTo ErrHand
    Set Data = rsFileMaterials
AfterErr:
    Exit Sub
ErrHand:
    Err.Raise vbObjectError + 1, "clsFileMaterials", Err.Description
    Resume AfterErr
End Sub

Private Sub Class_Initialize()
On Error GoTo ErrHand
    Set rsFileMaterials = New ADODB.Recordset
    rsFileMaterials.Open "SELECT Type " & _
                        "FROM XlResult " & _
                        "GROUP BY Type " & _
                        "HAVING Type Not in (SELECT MmAlias FROM MatchMType)
" & _
                        "ORDER BY Type", _
                        "Provider=Microsoft.jet.OLEDB.3.51;Data Source=" &
sGestCabDb, adOpenKeyset, adLockOptimistic
AfterErr:
    Exit Sub
ErrHand:
    Err.Raise vbObjectError + 1, "clsFileMaterials", Err.Description
    Resume AfterErr
End Sub

Private Sub Class_Terminate()
On Error GoTo ErrHand
    Set rsFileMaterials = Nothing
AfterErr:
    Exit Sub
ErrHand:
    Err.Raise vbObjectError + 2, "clsFileMaterials", Err.Description
    Resume AfterErr
End Sub

Public UpdateRecordset
    rsFileMaterials.Requery
End Sub



Sat, 09 Jun 2001 03:00:00 GMT  
 Requery Data Source Object based on ADO Recordset
You stupid....  :-)

Thank you gays...

Quote:

>Hi every one,

>I build an data source class to fill a ADO Data List.  For some reasons,
the
>data behond the list could change but the list wont update (of course).

>The problem is that when a make a requery of the object private recordset
>var, i get "Object was open" error. Here is the code of my object.

>Could some one help me ??
>Thanks.



Sat, 09 Jun 2001 03:00:00 GMT  
 Requery Data Source Object based on ADO Recordset
Are Dynamic cursors working against a MS Access Database ?


Quote:
>Just a possibility, try openning the recordset as adOpenDynamic instead of
>adOpenKeyset.  Keyset doesn't show added/deleted records (apparently).

Own


Sun, 10 Jun 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Requery Data Source Object based on ADO Recordset

2. ADO Recordset as TDC Data Source

3. How to get a single recordset from two Data Sources using ADO

4. Requery ADO recordset

5. ADO recordset requery

6. ADO Recordset requery

7. Trying to requery an ado recordset

8. ADO Recordset Requery

9. AddNew/REquery method of ADO Recordset not Working?

10. Data designer bound controls seem to lose their binding to the recordset with Requery

11. Data designer bound controls seem to lose their binding to the recordset with Requery

12. Mass Insert into SQL 6.5 from data in a RecordSet ADO object

 

 
Powered by phpBB® Forum Software