Problem Passing RecordSet as byRef Parameter in Com/ASP Environment



I'm having a big problem trying to return 3 recordsets from a VB6
component to my ASP page. I keep getting an unspecified error.


***Here is the ASP code used:


dim rsTemp, rsGroupCodes, rsTemp3
set rsTemp = createobject("ADODB.Recordset")
set rsGroupCodes =createobject("ADODB.Recordset")
set rsTemp3 = createobject("ADODB.Recordset")


set myObj = Server.CreateObject("MY_Project.clsName")


call myObj.GetAllRecordSets(rsTemp, rsGroupCodes, rsTemp3)


If Err.Number <> 0 Then
Response.Write "<B>Unable to read field value</B><P>"
Response.Write "Error Number : "& Err.Number
Response.Write " - Source : " & Err.Source
Response.Write " - " & Err.Description & "<P>"
Response.end
end if


***And here is the Component Sub code:


Public Sub GetAllRecordSets(ByRef rs1 As Variant, _
ByRef rs2 As Variant, _
ByRef rs3 As Variant)


On Error GoTo ErrorSpot


Dim lngErrNum As Long
Dim strErrDesc As String
Dim filterStr As String
Dim objConn As ADODB.Connection
Dim myrs1 As ADODB.Recordset
Dim myrs2 As ADODB.Recordset
Dim myrs3 As ADODB.Recordset


Set myrs1 = rs1
Set myrs2 = rs2
Set myrs3 = rs3


'Create the connection object, and use it to execute the SQL
Set objConn = CreateObject("ADODB.Connection")
With objConn
.CursorLocation = adUseClient
.CommandTimeout = 500
.ConnectionString = GetConnString("QG_DownCode")
.Open
.Execute ("set nocount on")


'Create Temp Tables
Set myrs1 = .Execute('create myrs1 sql to query temp tables)
Set myrs2 = .Execute('create myrs2 sql to query temp tables)
Set myrs3 = .Execute('create myrs3 sql to query temp tables)
'Drop Temp Tables
End With


Set rs1 = myrs1.Clone
Set rs2 = myrs2.Clone
Set rs3 = myrs3.Clone


ExitSpot:
'Cleanup
Exit Sub


ErrorSpot:
'Save the error information
lngErrNum = Err.Number
strErrDesc = Err.Description
'Raise error back to client
Err.Raise lngErrNum, "GetAllRecordSets", strErrDesc
End Sub

.



Relevant Pages

  • Please Help!! This will keep me from going on vacation!
    ... dim rsTemp, rsGroupCodes, rsTemp3 ... set rsTemp = createobject ... set rsGroupCodes =createobject ... Dim lngErrNum As Long ...
    (microsoft.public.vb.controls)
  • Passing a RecordSet to a VB6 component byRef
    ... dim rsTemp, rsGroupCodes, rsTemp3 ... set rsTemp = createobject ... set rsGroupCodes =createobject ... Dim lngErrNum As Long ...
    (microsoft.public.data.ado)
  • Problem Passing RecordSet as byRef Parameter in Com/ASP Environment
    ... dim rsTemp, rsGroupCodes, rsTemp3 ... set rsTemp = createobject ... set rsGroupCodes =createobject ... Dim lngErrNum As Long ...
    (microsoft.public.vb.controls)
  • Re: Cancel Command
    ... Dim stDocName As String ... Dim stLinkCriteria As String ... Set dbcurrent = CurrentDb ... Set rstemp = Nothing ...
    (microsoft.public.access.forms)
  • Re: please help me for my code
    ... If you are not submitting the form, then using a text-box will not be ... dim myConnection ... Set myConnection = Server.CreateObject ... set rsTemp = myConnection.execute ...
    (microsoft.public.frontpage.programming)