Results 1 to 3 of 3

Thread: Functions Returning recordset

  1. #1

    Thread Starter
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261
    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.
    - regards -
    - razzaj -

  2. #2
    PeterCr
    Guest
    Have you tried to add the following code to your DDL-function?

    set GetUsers = New ADODB.Recordset



  3. #3
    New Member
    Join Date
    May 2001
    Posts
    15
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width