The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Local Dataset Cache

I have an ASP Application (website) that I am writing that returns records from an SQL Query to the client. I want to store some of this data at the client for use on other pages, to be used as filtering criteria for later SQL Queries.

I was hoping to avoid re-posting this data from Form Page for Form Page. Can I somehow cache it on the server in a session cookie (I think thats what it's called), or on the client so that it is accessible?

OK, but I am lost at how to incorporate this in practice with an undetermine number of recordset rows that is returned in page1.asp; that I need to keep the details of through the session. Please forgive my noviceness; I am a sys-admin much more than I am a developer.

What is page1.asp doing that can't be done in nextpage.asp? To be honest, you don't want to be passing massive amounts of data between the pages - it's much more efficient to just pass a relevant key/reference and run the SQL in nextpage.asp

But if you want to pass multiple related items, use arrays for the session variables - you're almost there.

I was researching Session(array) last night. Thank you; you're definately helping me in the right direction.

To be completely honest; this code is for a student report card; online interface. The school I work for is still in the dark ages with an antiquated Student System that does not have an online report card. I do now; with what I've written, but I am trying to make it more 'intuative' and detailed.

Performance:
It was my concern that as 300+ students will probably hit this thing every morning; the fewer queries to the data-tables the better. Not to mention all the faculty in the fat-gui front end taking attendance at the same time.
The session caching I want to do is the data table primary keys for each class grade-book; so that I can re-present the list of enrolled classes on every page so they can be navigated between; then I only have to query the currently viewed class grade detail from the data-tables. In order to determine the course/class list; I have to open several tables to establish the relationships; and I presume this is a load at the very least in the IIS ASP Worker Process.

Am I wrong in my thinking about performance?

The Session Array would store possibly up to 24 rows, with only three columns per row. Each Cell is only about 6 characters in length. (Course Number, Gradbook Student Enrollment Primary Key, Student Foriegn Key).

The Session Array would store possibly up to 24 rows, with only three columns per row. Each Cell is only about 6 characters in length. (Course Number, Gradbook Student Enrollment Primary Key, Student Foriegn Key).

So that's 3 x 24 x 6 = 432 bytes, plus session overheads, per user. In the grand scheme of things this is not such an issue, even with, say, 500 users - but this would mean the sessions using up 250KB+ of RAM on the web server.

In an ASP page a database transaction takes milliseconds. So as long as you open up the connection as late as possible, get the data, then close it as early as possible (in the ASP code), then you shouldn't have any issues with multiple users clashing with database access.

Surely FoxPro can't be any worse than MS Access, which only allows 10 concurrent connections (in real world figures)? Access is used by quite a number of web applications which maybe have up to a 1000 users, and a well-devised application copes well.

IMHO the way to go is to use sessions to maintain key data (e.g. User ID), then get the main info via SQL calls in the respective pages based on the session values.

Your expertise is very insightful. Thank you very much... I appreciate your time and comments.

I'm thinking that the RAM overhead (less than 1MB) on the Web-Application server is severly minimal in the grand scheme of things; and the end result is a faster enumeration of the object page (nextpage.asp); rather than two separate DataSet queries on the page. I am not concerned if the Web-App even consumes 30MB of RAM; as long as it's for performance gains and minimized resource dependancies all around.

So, is this a good place to find Classic ASP developers for hire with expertise in ADO (Active Directory) and SQL integration? I have a few projects I could spend some money on; and I am sure I am 'inefficient' comparatively.

OK, so we're running. The Session variables to carry to the next page. In order to use the array's I had to declare them in nextpage.asp. When I declared them as dynamic array's (ie. aPkey() ) it did not like that. I had to declare and refer to the arrays as just the name of the array ( ie. aPkey ).

Being the extrordinary novice at programming as I am; there is no way I would have known this, and I'm still not sure I truely understand they why or how its different. But that's OK; I'm good with being a novice, and just doing what is expected.

So one issue I have is that the session values seem to get lost after about 1 minute. So when I go from page1.asp to nextpage.asp; the array is successfully parsed. But if I refresh nextpage.asp after about 60 seconds; the array is empty. Where is the setting to determine the timeout of the session data?