Passing current ADO Record to another function
adodb, vb6, vba
Solution
Personally, I would pass the entire recordset in to the ProcessRecord subroutine. Recordsets are always passed by reference so there is no overhead (performance or memory consumption) passing a recordset around. Just make sure you don't move to the next record in the ProcessRecord subroutine.
Problem
Perhaps I've spent too much time in .NET, but it seems odd that I cannot easily pass the current Record of an ADO RecordSet to another method. ``` Private Sub ProcessData(data As ADODB.Recordset) While (Not data.EOF) ProcessRecord ([data.CurrentRecord]) ' <-- There is no CurrentRecord property. data.MoveNext Wend End Sub Private Sub ProcessRecord(singleRecord As ADODB.Record) ' Do stuff. End Sub ``` The scant info I've found on the subject says to pass the entire RecordSet or to create a new Record and manually copy each field to it. StackOverflow, is there a better way?