Okay, I am trying to develop a COM+ dll that will do all interactions with a database from an ASP page that I am developing. I am developing the dll, as well as some test code in VB and that's where I am now.
My VB test code calls a Method in my dll that gets a recordset from a database:
Dim rsCurr As ADODB.Recordset
Set rsCurr = m_currObject.LoadClaimantForm
This works beautifully. Now, my problem is with updating the recordset. The form that I'm creating will have over 70 fields on it. It is just not feasible to create a property for each field in the dll and then update the properties so that I can update the recordset. What I would like to do is update the recordset that I use locally on the form with the changed values and then pass this recordset to the dll so that the actual database update occurs from the dll, not the form. I don't know how to do this. This is what I tried, but didn't work:
FROM THE FORM:
m_currObject.SaveClaimantForm(rsCurr)
FROM THE DLL:
Public Sub SaveClaimantForm(rsClaimant As ADODB.Recordset)
Set m_rsCurrRS = rsClaimant
Set m_rsCurrRS.ActiveConnection = m_oCurrConnection
m_rsCurrRS.Update
Set m_rsCurrRS.ActiveConnection = Nothing
End Sub
What am I doing wrong and what should I be doing to make this work? Please help me, I would really appreciate it.
My VB test code calls a Method in my dll that gets a recordset from a database:
Dim rsCurr As ADODB.Recordset
Set rsCurr = m_currObject.LoadClaimantForm
This works beautifully. Now, my problem is with updating the recordset. The form that I'm creating will have over 70 fields on it. It is just not feasible to create a property for each field in the dll and then update the properties so that I can update the recordset. What I would like to do is update the recordset that I use locally on the form with the changed values and then pass this recordset to the dll so that the actual database update occurs from the dll, not the form. I don't know how to do this. This is what I tried, but didn't work:
FROM THE FORM:
m_currObject.SaveClaimantForm(rsCurr)
FROM THE DLL:
Public Sub SaveClaimantForm(rsClaimant As ADODB.Recordset)
Set m_rsCurrRS = rsClaimant
Set m_rsCurrRS.ActiveConnection = m_oCurrConnection
m_rsCurrRS.Update
Set m_rsCurrRS.ActiveConnection = Nothing
End Sub
What am I doing wrong and what should I be doing to make this work? Please help me, I would really appreciate it.