Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Information on GetDataMember


Message #1 by "David" <davidbradley@h...> on Fri, 11 May 2001 04:48:39
You may want to check the Err.Number property to see what number it is
giving you.

-----Original Message-----
From: David [mailto:davidbradley@h...]
Sent: Friday, May 11, 2001 5:01 PM
To: professional vb
Subject: [pro_vb] RE: Information on GetDataMember


The ADO error is not realy my problem.  I just need the raised error to 
noticed by the calling procedure.  When I raise an error in the 
GetDataMember event, it does not seem to be returned to the calling 
procedure.  My GetDataMember event is in a class that is in an ActiveX dll 
project and my calling procedure is in an EXE.  Does anyone know why my 
error number is not returned and how to resolve it.


Here is some the code to call the GetDataMember.

Private Sub Command1_Click()
    On Error GoTo ERRHANDLER
    
    Dim objPersist As NADocsPersist
    
    Set objPersist = New NADocsPersist
    
    Dim bind As New BindingCollection
    
    ' Set the connection string.
    objPersist.Load GetCriteriaState, mConnectStr   
    
    Set bind.DataSource = objPersist
                
    Set Data = objPersist
    
    Set objPersist = Nothing
    
    Exit Sub

ERRHANDLER:
    MsgBox "NADocs"
    Err.Raise vbObjectError + 513, "TSSDocObjs.NADocs"

End Sub




Here is the code for my GetDataMemberEvent

Private Sub Class_GetDataMember(DataMember As String, Data As Object)
    ' Load the collection with data.
    '
    ' Created By:   David Bradley 5/7/01
    ' Modified By:
    '
    On Error GoTo ERRHANDLER
    
    Dim objPersist As NADocsPersist
    
    Set objPersist = New NADocsPersist
    
    Dim bind As New BindingCollection
    
    objPersist.Load GetCriteriaState, mConnectStr
    
    Set bind.DataSource = objPersist
        
    If Err <> 0 Then _
        GoTo ERRHANDLER
        
    Set Data = objPersist
    
    Set objPersist = Nothing
    
    Exit Sub

ERRHANDLER:
    MsgBox "NADocs"
    Err.Raise vbObjectError + 513, "TSSDocObjs.NADocs"

End Sub



Thanks,

David

  Return to Index