Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
editing values in a result set
Old 03-27-2006, 03:27 PM editing values in a result set
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi

I have a recordSet that can have say up to 30 records in it.

the records are rendered to a web page for viewing

I wish to offer the client capacity to change the last field in the report which is due_date

How do i define the form and then update the changed fields to the database.

cheers
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 03-27-2006, 07:36 PM Re: editing values in a result set
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Code:
<form action="whatever">
<table>
for i = 1 to 30 ' or whatever your recordset count is.
<tr>
<td>Field 1</td>
<td>Field 2</td>
<td>Field 3</td>
 
...
 
<td>
<input type="text" name="due_date" value="<% = Whatever_Your_Due_Date_Is %>" />
<input type="hidden" name="Unique_Identifier" value="<%= Whatever_Your_Unique_Identifier_Is_Probably_An_Autonumber_From_Access %>" />
</td>
</tr>
Next
</table>
<input type="submit" value="Submit" />
</form>
Then to process:
Code:
Dim Unique_Identifier, Due_Date
Due_Date = Split (Request.Form ("Due_Date"), ", ") ' You need to split the Due Date and the Unique Identifier up since the form field will return multiple values that are comma-separated. This code will split the Due Date up into an array of the individual Due Date values.
Unique_Identifier = Split (Request.Form ("Unique_Identifier"), ", ")
for i = 0 to UBound (Due_Date)
     if IsDate (Due_Date (i)) then ' Check each Due Date to see that it's a valid date.
          database_connection.Execute ("Update Your_Table Set Due_Date = #" & Due_Date (i) & "# where Unique_IDentifier = " & Unique_Identifier (i))
     end if
Next
This won't be perfect code, and it's not optimized for speed, but it should give you the general idea.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)

Last edited by ADAM Web Design; 03-27-2006 at 07:37 PM..
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to editing values in a result set
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18088 seconds with 12 queries