[thelist] SQL Update Query - Easy
Rob Smith
rob.smith at THERMON.com
Wed Jan 26 15:25:59 CST 2005
Alright I'm going to set the stage:
<form action="Received.asp" method="get">
<input type="hidden" name="partID" value="2">
<%
while not RS.eof
%>
<!-- insert about 2000 checkboxes with different values
all with name="Video" :-\ This creates a comma
delimited list called Video --->
<%
RS.movenext
wend
%>
<input type="submit" value="Checked In">
</form>
on Received.asp:
Videos = request.QueryString("Video")
Video = split(trim(Videos),",")
counter = 0
set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = MM_web_request_STRING
RS.CursorType = 0
RS.CursorLocation = 2
RS.LockType = 3
while counter < uBound(Video)+1
RS.Source = "Update tblVideos SET CheckedIn = 1 WHERE Video = '" &
Video(counter) & "'"
RS.Open()
counter = counter + 1
wend
This will update the first record even when there are about 10 "Video's"
checked off of the original form... Even when I do a quick response.write
<query string> I see 10 Updates wiz across the screen. Yet only one, 1, uno,
een gets updated. The others are lost.
Why?
Rob
Rob Smith
More information about the thelist
mailing list