Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing recordset into a procedure

Status
Not open for further replies.

johnaregan

Programmer
Mar 13, 2001
87
hi
Just a quick question, how do you pass a recordset into a Sub procedure by reference?
 
Well, hopfully I'm not misunderstanding you, but here is what I have used,

-------------page1.asp----------------------------
<%
set conn = server.createobject(&quot;adodb.connection&quot;)
dsntemp = &quot;myDSN&quot;
conn.open dsntemp
set rs = server.createobject(&quot;adodb.recordset&quot;)
rs.open sql, conn, 3, 3

response.write(&quot;Click on button 1 signup...&quot;)
response.write(&quot;<input type='button' value='Button 1' onClick='signup('&quot; & rs(&quot;firstName&quot;) & &quot;', '&quot; & rs(&quot;lastName&quot;) & &quot;')'>&quot;)
conn.Close
set conn = nothing
%>
<Script language=&quot;VBscript&quot;>
<!--
Sub signup(fname, lname)

parent.window.location.href = &quot;page2.asp?fn=&quot; & fname & &quot;&ln=&quot; & lname & &quot;&quot;

End Sub
-->
</script>
----------------------------------------------

Pullin that off the top of my head, don't have the actual script that I used...but is is either that, or very very close to that. Hope that is what you were looking for.

-Ovatvvon











 
It sounds to me that he is attempting to pass the recordset object into a method like so:

SET oRS = CreateObject(&quot;ADODB.Recordset&quot;)
SET oDest = CreateObject(&quot;MyDLL.MyObject&quot;)
oDest.MyMethod oRS

But why must it be passed by reference? I'd recommend you read the following KB article, along with the ones in the reference section at the bottom:
INFO: Type Mismatch Errors When You Pass Parameters from ASP to a Visual Basic Component
Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top