Ask a Question related to ASP Database, Design and Development.
-
BP Prgm #1
updating multiple records on one page
I'm a moderate newcomer to ASP... I have a SQL Server database. I am
displaying multiple records on a page. I have a field in the database called
LatestUpdate. I read multiple records out of the database and put the
LatestUpdate data into a text box. I want the user to be able to edit
multiple text boxes and save them all with one click. At the bottom of the
page I will put a "Save All" button so I can update all records. How do I
make the "Save All" button update each record?
Thanks in advance! Code is always appreciated :-)
BP Prgm Guest
-
Updating multiple records in a linked table simultaneously
I am working on an e-commerce application and I need help with updating the product details for a single product with multiple formats. --DB... -
Updating Multiple records fields in a database atonce
Is it correct that there is no user interaction on these forms? I didn't see a submit button. Or does someone click on a submit button to get to... -
How to display multiple records per page?
How can i build the easiest way an script which enables me to display an x amount of records per page? Friendly greetings, André -
updating multiple records via online form
Hello, I have a database generated form that I would like users to be able to update by selecting a checkbox. Say the page displayed has six... -
Updating Multiple Records
I have a table in a database that contains all my photos. The fields are like Name, SRC, GalleryName, DateAdded, SpecialStyle. The only one you may... -
Ray at home #2
Re: updating multiple records on one page
One way to do it is name your textboxes in a certain way, like with all the
same name but with an ID number as a suffix or something along those lines.
Something like this:
<form method="post" action="whatever.asp">
<input name="txtFirstname1" value="Jorg" type="text">
<input name="txtFirstname32" value="Marissa" type="text">>
<input name="txtFirstname45" value="Kylie" type="text">>
<input name="txtFirstname94" value="Yanni" type="text">>
<input name="cmdSubmit" value="Update All" type="submit">
</form>
On the page that processes:
<%
'''assuming multiple submit buttons all having the same name
If Instr(Request.Form("cmdSubmit"), "Update All") > 0 Then
'''update all
For Each f in Request.Form
If Instr(f, "txtFirstname") = 1 Then
'''this is a firstname textbox
'''get the record ID
sRecordID = Right(f, Len(f) - Len("txtFirstname"))
sFirstname = "'" & Replace(Request.Form(f),"'", "''))
sSQL = "UPDATE [TheTable] SET [Firstname]=" & sFirstname & "
WHERE [ID]=" & sRecordID
oYourADOConnection.Execute sSQL
End If
Next
oYourADOConnection.Close
Set oYourADOConnection = Nothing
End If
Actually, if you're having an option to update just one or update all, your
submit buttons will probably all have different names. But that won't
affect the code significantly.
Ray at home
"BP Prgm" <nospam@please.com> wrote in message
news:OeN03oJfDHA.3024@tk2msftngp13.phx.gbl...called> I'm a moderate newcomer to ASP... I have a SQL Server database. I am
> displaying multiple records on a page. I have a field in the database> LatestUpdate. I read multiple records out of the database and put the
> LatestUpdate data into a text box. I want the user to be able to edit
> multiple text boxes and save them all with one click. At the bottom of the
> page I will put a "Save All" button so I can update all records. How do I
> make the "Save All" button update each record?
>
> Thanks in advance! Code is always appreciated :-)
>
>
Ray at home Guest



Reply With Quote

