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.