Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Variables across pages

Status
Not open for further replies.

Pandyon

Programmer
Feb 21, 2001
38
US
I'll try to be as short as possible.
Using vbScript to run a query of a Stored Procedure (query) in Access. Selecting all records which fit criteria (about 5 parameters), then listing all results in a table in HTML.

Here's the deal. There are about 10 fields to each record but I'm only showing 4 in the table. I want the user to be able to click on a "details" link (in the table next to each record) which then passes all 10 fields for that record to a new page.

I want to know the &quot;most efficient&quot; way to do this. Right now, I'm passing the information through the hyperlink &quot;details&quot; using &quot;...details.asp?City=<%Showset(&quot;City&quot;)%>&Phone=<%Showset(&quot;Phone&quot;)%>...etc.&quot;

Something tells me this isn't the best way to do it. I want to close my connection as soon as I've queried the data, but would like to bounce back and forth between the list and details pages. Would using GETSTRING, then parsing it out be better? Or should I just requery the recordset on the new page selecting only one record?

Design Confused...
 
Pandyon,
On HTTP, connections are stateless i.e., they are never maintained. Once a page is displayed no connections to any server are maintained even if you don't close the connections to the database.

So depending on your requirements, you might want to actually query the database for displaying the details fields instead of storing the data in the summary page itself. This would be a better idea if your details are much more than your summary since in that case, even your summary page would take longer to load if you want to store the details in hidden fields.

Hope this was useful.
 
I agree with Antzz. You should requery the database in your detail page again. This way you don't have to pass all but your primary key through your QueryString (to pull out that specific record). Also, it means that you don't have to Server.URLEncode each variable before you send it across to the detail page. It is also more secure. That QueryString can be logged, cached (in history), or stored very easily, and if it contained ALL the information, it could be a bad security problem. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top