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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allowing users to develop projections of a table using an ASP app 1

Status
Not open for further replies.

DavidArchibald

IS-IT--Management
Oct 29, 2000
20
0
0
NZ
Hi there

At this stage, I'm looking for general ideas, not code, to solve my problem.

I have an ASP web application with a MS 2000 Access database backend.

The users can view a summary of results from over a number of weeks. The clients sees a view of the various tables based on a query.

What I want to be able to do the following: allow the users to add their projections for the next and subsequent weeks.

What I would like is ideas of how best to do this. The idea I have is to create a unique copy of the table, add the projections then use this data to generate the report for the user. When the user disconnects, I will ditch the temp table.

Is there an easier or better way to do this ie disconnected recordsets??

Any suggestions are welcomed and would be gratefully received. Please let me know if I haven't made myself clear.

Cheers

 
A disconnected recordset would work in this case -- but it sounds like more magic than it really would be:

Let's say that you already have a recordset with a cursor location declared of adUseClient (now it's disconnected -- but even a server side cursor would work in this case) -- Also, set lockType to adLockBatchOptimistic -- then you can just use the .addNew method of the recordset to start adding your new records to your recordset... as long as you don't call the .updateBatch method of your recordset, then the changes will not be saved to the database.

So here comes the gotcha --

Because you'll be asking for client side input, and your recordset is a server side object, it's going to take a reload of the page to display new results... so here's what I would suggest:

First load of the page:
Create the query that displays your data (you already have this part, yes?), and then store that sql statement in a session variable.

Do your output

Ask for the user's input. Then they press a button which reloads the page.

Second load of the page:
Recreate the exact same recordset from the stored query that you have in your session variable, and then read the user's input and start .addNew to your recordset BEFORE you start any output.

Once you have added all of their information to the existing recordset, go ahead and .moveFirst on the recordset and output away. The new data will be reflected in your output -- but the database, itself, will not have changed unless you call .updateBatch after you .addNew

hope that helps! :)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top