Can't pass Recordset?


Joined
Dec 18, 2011
Messages
1
Reaction score
0
I have a class with a function accepting a recordset as a parameter. I'm specifying 'ADODB' in both the declarations and the parameters. Though I'm not sure why it would matter being as though I don't even have the DAO library referenced. I've compacted and repaired, tried ByVal and ByRef Parameters, with and without parenthesis; I'm spent on it. I had the exact same problem when trying to call a different method accepting a recordset as a parameter in the line of code above it. In that case I removed the parenthesis and there weren't any other issues. Regardless of everything said, I still can't get past the RTE: 13. I've posted the code below... can anyone help?

MyModule:
[vb]
Public Sub MySub()

Dim Conn As ADODB.Connection
Dim strFittingSQL As String
Dim rsFittings As ADODB.Recordset
Dim MyRsChecker As clsRecordsetEvaluator
Dim blnFittingsCorrect As Boolean
Dim blnStraightChannelCorrect As Boolean
Set Conn = CurrentProject.Connection
Set rsFittings = New ADODB.Recordset
Set MyRsChecker = New clsRecordsetEvaluator

strFittingSQL = "Select MY_TABLE.* From MY_TABLE Where Instr(MY_TABLE.FITTING_TYPE,'COVER')=0 and " & _
"Instr(MY_TABLE.FITTING_TYPE,'STRAIGHT')=0"

With rsFittings
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open strFittingSQL, Conn
End With

blnStraightChannelCorrect = MyRsChecker.CheckStraightChannel rsStraightChan
'Here is where I receive RTE 13
blnFittingsCorrect = MyRsChecker.CheckChannelFittings rsFittings

MsgBox "Finished"

End Sub
[/vb]
MyClassModule:
[vb]
Function CheckChannelFittings(rsFittingCollection As ADODB.Recordset) As Boolean

'My Code in here

End Function
[/vb]


I can't see the error, thank you in advance.
-ReadyToKickSomething
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top