Re: Help with Updating Multiple records via Looping
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 27 Dec 2006 15:54:07 -0500
jbarnes5@xxxxxxxxxxxxxxx wrote:
This is the first page......
<select size="1" name="Q1_<%=i%>" onChange="calc(<%=i%>)">
<option selected value="<% =rsScores("Q1")
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<%
rsScores.movenext
loop
%>
<input type="hidden" name="x" value="<%=i%>">
This is the page that it posts to......
Dim strID, QQ1
Set Conn5S = Server.CreateObject("ADODB.Connection")
Conn5S.Open "Provider=sqloledb;Data
Source=ebs-sqlc1-vs3.edn.runi.com\SSS;UID=casuser;PWD=hppccas;DATABASE=skills"
count = Request.Form("x") - 1
for i = 0 to (count)
strID = Request.form("Emp & " i " &"'")
QQ1= Request.form("Q1 & " i " &"'")
sSQL = "UPDATE ECuryear SET Q1= '" & QQ1 & "' where (empid ='" & strID
& "')"
Conn5S.Execute(sSQL)
NEXT
When I execute the web page with a response.write on the sequel
statement, this is what it returns. Does anyone see what I am doing
wrong?
UPDATE ECuryear SET Q1= '' where (empid ='')
The only way to find out will be to look at the result of posting your form
a page containing to this:
<%
Dim strID, QQ1
count = Request.Form("x") - 1
Response.Write "count contains '" & count & "'<BR>"
for i = 0 to (count)
Response.Write "i contains '" & i & "'<BR>"
strID = Request.form("Emp & " i " &"'")
Response.Write "strID contains '" & strID & "'<BR>"
QQ1= Request.form("Q1 & " i " &"'")
Response.Write "QQ1 contains '" & QQ1 & "'<BR>"
sSQL = "UPDATE ECuryear SET Q1= '" & QQ1 & "' where (empid ='" & strID
& "')"
Response.Write "sSQL contains '" & sSQL & "'<BR>"
NEXT
%>
You will probably get more responses in an ASP group like
m.p.inetserver.asp.general
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- References:
- Help with Updating Multiple records via Looping
- From: jbarnes5
- Help with Updating Multiple records via Looping
- Prev by Date: Help with Updating Multiple records via Looping
- Next by Date: Re: Tips for improving efficiency?
- Previous by thread: Help with Updating Multiple records via Looping
- Next by thread: Re: Tips for improving efficiency?
- Index(es):
Relevant Pages
|
|