Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Apr 14, 2000

Passing Recordset Object Between ASP Pages

Question:

I have an ASP called 'default.asp' that creates a recordset object called 'objRS' via ODBC. When a certain set of conditions is met, I linked it to another ASP page called 'seenbuy.asp' that needs to perform some actions based on 'objRS'.

'Seenbuy.asp' does not know what 'objRS' is because that variable is declared private within 'default.asp'. I know that I can pass variables with query strings, but can I pass this object 'objRS' to 'seenbuy.asp' using a query string? Or should I simply declare 'objRS' as a public variable (though this doesn't seem like the best solution to me due to possible memory issues later as public variables eat memory)?

Answer:
One ASP page cannot see another page's variables, as you mentioned. I would suggest you perform the query, saving the recordset to a filename. I would pass that filename to the next ASP page, and then reload the recordset using the passed filename. For any sizable query this will be a major improvement.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date