YZlat
asked on
How to update a dummy recordset with classic ASP
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:
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?
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
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?
ASKER
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
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