Sub | Sql_CopyFields(ByVal rsSource As ADODB.Recordset, ByVal rsDest As ADODB.Recordset, Optional ByVal strNegFieldList As String = "|DSN|KENNUNG|STAMP|") |
---|---|
rsSource: Quell-Datensatz rsDest: Ziel-Datensatz strNegFieldList: Liste der nicht zu kopierenden Felder z.B. Stamp (Typ binär) kann nicht kopiert werden Public Sub Sql_CopyFields(ByVal rsSource As ADODB.Recordset, ByVal rsDest As ADODB.Recordset, Optional ByVal strNegFieldList As String = "|DSN|KENNUNG|STAMP|") Dim oField As ADODB.Field '-- Felder kopieren - außer dsn, kennung, ... For Each oField In rsSource.Fields If InStr(strNegFieldList, "|" & UCase(oField.Name) & "|") = 0 Then rsDest.Fields.Item(oField.Name).value = oField.value End If Next End Sub |