-
I am writing a DLL that is to be used from ASP.
some functions in my classes have to return a REcordset.
of type ADODB.REcordset.
here is how I wrote the functions :
Code:
public function GetUsers (Catid as Integer) as ADODB.Recordset
dim Rec as ADODB.REcordset
[ ... perform any selection from database ... ]
'Store Results in REC
' Return Results
Set GetUsers = Rec
End function
In ASP I used the following code to call this function:
Code:
<%
Dim COmObj
DIm Rec
Set Rec = Server.CreateObject("ADODB.REcordset")
Set ComObj = Server.CreateObject("MyObj.MyClass")
Rec = COmObj.GetUSers(10)
%>
bu I am getting an Error in My Dll "Object or Block Variable not Set"
now it is clear some thing is wrong. But what.
Please any help is greatly appreciated.
-
Have you tried to add the following code to your DDL-function?
set GetUsers = New ADODB.Recordset
:cool:
-
First of all you don't need the following line in ASP...
"Set Rec = Server.CreateObject("ADODB.REcordset")"
Your object should create the recordset for you... all
you need is this line..
"Set Rec = COmObj.GetUSers(10)"
PS. You might have just forgotten the "Set" statement.