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

Incrementing carried variables

Status
Not open for further replies.

Chopstik

Technical User
Oct 24, 2001
2,180
US
I'm creating a web application that will temporarily store detail level information until the user has finished entering, and then when prompted will update the database. My problem is this:

I need to be able to have the user go to the page and if there is no record, begin the first record. If a record exists, find the last one, increment plus one, and then add the next record. My boss (who is a little more literate in this than I) suggested something along the lines of this:

dim i = 0
while len(request.form("detail") & cInt(i)) = 0
i = i + 1
wend 'or something along this line and detail referencing a field in the request form.
value = request.form(field) & cInt(i)
value2 = request.form(field2) & cInt(i)
response.write value
etc.

How can I properly increment this so that each record will be saved separately until I am ready to execute the UPDATE command? Any help would be greatly appreciated!
 
hi,

im not sure i understand fully what you need but,
if you need to keep the last record inserted than kepp it on a Session variable when on_start will equal 0.

if you need to retrieve from DB you might wanna use an xml file which will hold the data of the last record id, and communicate with that xml by msxml.

anyway hope this helps,

raikyng.
 
Sorry, knew I probably didn't sound very clear in my original message. Am planning on saving my data in a form using hidden variables (until I'm ready to load all of the data at one time to the db). What I want to do is to save each record individually so that they will be organised by the incrementing number. For example,

record1.value1 = form.request("field1") & cStr(i) 'where i is the incremented count.

And for each i, the 5 fields will be saved individually. Does this make more sense? Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top