Solved

How to update a dummy recordset with classic ASP

Posted on 2016-09-01
4
85 Views
Last Modified: 2016-09-02
I have a page where I display dummy data - have created and populated a dummy recordset, just for demo purposes. Now when the user clicks one of the buttons on the page, I want to update a record in that dummy recordset while staying on the page. I originally wanted to use AJAX but not sure how to do that without having an actual database to update.

Below is my code for loading the Recordset with dummy data:

					'Add Fields and Values to Recordset
					With RS.Fields
						.Append "ID", adBSTR
						.Append "SubmitDate", adDate
						.Append "Name", adBSTR
						.Append "Status", adBSTR
					End With
					
					'Open the Recordset
					RS.Open
					
					'Populate the Data in the Recordset
					With RS
						.AddNew
						.Fields("ID")="1111"
						.Fields("SubmitDate")="8/26/2016"
						.Fields("Name")="Doe, John"
						.Fields("Status") = "In Progress"
						.Update
					End With

					With RS
						.AddNew
						.Fields("ID")="2222"
						.Fields("SubmitDate")="7/14/2016"
						.Fields("Name")="Doe, Jane"
						.Fields("Status") = "Completed"
						.Update
					End With

Open in new window


The above records are displayed in a table format and each table row has a button it its last column. When this button is clicked, the Status field of the corresponding record should be set to "Completed"

How would I update record with ID="1111" to set the field Status to "Completed" from button click?
0
Comment
Question by:YZlat
  • 2
  • 2
4 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 41780459
that recordset only stays in memory until the page is served to the client, it then is gone from memory unless you put it in session variable....

maybe you can explain a bit more on exactly what you want to have happen on the page? if the data is ultimately going to come from a database, I highly recommend just setting up a dummy table with the data, then code using the database as your source of data
0
 
LVL 35

Author Comment

by:YZlat
ID: 41780666
Eventually the data will come from the database but setting up a dummy table will not be viable at this point. So there isn't really a way to update the temp recordset?
0
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 41780745
i would store the data in some kind of data format (delimited string, json, xml, text file, etc) and keep that in a session variable, then use that as your data source. you can also experiment with putting a record set into memory, although it's been my experience that objects don't play well when in session variables...
0
 
LVL 35

Author Comment

by:YZlat
ID: 41782150
Thank you
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question