Here's a subroutine that uses ADO within a COM component to save data from the object back to a database recordset. This code makes the assumption that there is a property with the same name as each database field. The code also takes care of cases in which there is a non-editable field, such as a counter. The code will skip these by using the Attributes property of the field. Make sure the recordset is opened to the record being edited before calling this code.
Public Sub SaveObject(objInput As Object, rsInput As ADODB.Recordset)
Dim objField As ADODB.Field
Dim varResult As Variant
For Each objField In rsInput.Fields
If objField.Attributes And adFldUpdatable Then
varResult = CallByName(objInput, objField.Name, VbGet)
If TypeName(varResult) <> "String" Then
rsInput(objField.Name) = varResult
ElseIf varResult <> "" Then
rsInput(objField.Name) = varResult
Else
rsInput(objField.Name) = ""
End If
End If
Next objField
End Sub