Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Passing Recordset Object Between ASP Pages


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)?

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.



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