Problem Passing RecordSet as byRef Parameter in Com/ASP Environment
- From: "JJR2527" <Jason.Rendel@xxxxxxxxx>
- Date: 26 Oct 2005 21:20:51 -0700
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
.
- Prev by Date: Passing a RecordSet to a VB6 component byRef
- Next by Date: Re: ADO Performance question
- Previous by thread: Passing a RecordSet to a VB6 component byRef
- Next by thread: Re: Returning a single record: is adExecuteRecord a mistake in docs?
- Index(es):
Relevant Pages
|
|