PC Review


Reply
Thread Tools Rate Thread

Can't pass Recordset?

 
 
New Member
Join Date: Dec 2011
Posts: 1
 
      19th Dec 2011
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:58 AM.