Accessing a recordset created in a function within

Results 1 to 2 of 2

Thread: Accessing a recordset created in a function within

  1. #1
    Join Date
    Dec 1969

    Default Accessing a recordset created in a function within

    I have a select statement that I execute on several pages. To increase performance I was wondering if I could put this into a function and call an include file whenever I need it. My problem is how to access the recordset? I need to loop through it in each of my pages and when I do this I get an object required error because I create the object in the ssi. Any ideas on how I can do this?

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: Accessing a recordset created in a function wi

    Well in the end it is the same thing as having it on your page or in an include file the only diff is there is less TYPING for you to do on each page....if that makes you happy then go ahead with the include file.<BR><BR><BR>no for you rmain problem with the object required....when you create a recordset IN a function the SCOPE of the recordset (object) in ONLY IN THAT function and cannot be accessed outside that functin UNLESS<BR><BR>you declare the recordset object OUTSIDE the function in the main ASP code then its scope will extend for the entire page <BR>OR<BR>Have that functin rerutn an array which you will then loop thogugh and populate your page<BR>OR<BR>Have it return a recordset which you will use.<BR><BR>I would go with the first method.....

Posting Permissions

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