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=hppcca s;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 ='')
Re: Help with Updating Multiple Records via Looping
am 27.12.2006 22:04:11 von reb01501
jbarnes5@midsouth.rr.com wrote:
> This is the first page......
>
>
> <%
> rsScores.movenext
> loop
> %>
>
>
>
> 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=hppcca s;DATABASE=skilĀls"
>
> 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 & "' "
for i = 0 to (count)
Response.Write "i contains '" & i & "' "
strID = Request.form("Emp & " i " &"'")
Response.Write "strID contains '" & strID & "' "
QQ1= Request.form("Q1 & " i " &"'")
Response.Write "QQ1 contains '" & QQ1 & "' "
sSQL = "UPDATE ECuryear SET Q1= '" & QQ1 & "' where (empid ='" & strID
& "')"
Response.Write "sSQL contains '" & sSQL & "' "
NEXT
%>
--
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"
Re: Help with Updating Multiple Records via Looping
am 27.12.2006 22:14:50 von Bob Lehmann
I'm guessing that what you are trying to do is to cat your counter with the
form element value. The code you supplied is mess, so it's hard to tell.
But, anyhoooo.......
strID = Request.form("Emp" & i )
QQ1= Request.form("Q1" & i )
Also, I don't see that you have an element named "Emp"
Bob Lehmann
"pmarisole" wrote in message
news:1167249276.204142.71530@42g2000cwt.googlegroups.com...
> This is the first page......
>
>
> <%
> rsScores.movenext
> loop
> %>
>
>
> 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=hppcca s;DATABASE=skill
s"
> 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 ='')
>
Re: Help with Updating Multiple Records via Looping
am 27.12.2006 22:29:26 von reb01501
Bob Barrows [MVP] wrote:
>
> <%
> Dim strID, QQ1
> count = Request.Form("x") - 1
> Response.Write "count contains '" & count & "' "
> for i = 0 to (count)
> Response.Write "i contains '" & i & "' "
> strID = Request.form("Emp & " i " &"'")
> Response.Write "strID contains '" & strID & "' "
> QQ1= Request.form("Q1 & " i " &"'")
> Response.Write "QQ1 contains '" & QQ1 & "' "
> sSQL = "UPDATE ECuryear SET Q1= '" & QQ1 & "' where (empid ='" & strID
> & "')"
> Response.Write "sSQL contains '" & sSQL & "' "
> NEXT
> %>
actually, it should look like this:
<%
Dim key, strID, QQ1
For Each key in Request.Form
Response.Write "Request.Form(key) contains '" & _
Request.Form(key) & "' "
Next
count = Request.Form("x") - 1
Response.Write "count contains '" & count & "' "
for i = 0 to (count)
Response.Write "i contains '" & i & "' "
strID = Request.form("Emp & " i " &"'")
Response.Write "strID contains '" & strID & "' "
QQ1= Request.form("Q1 & " i " &"'")
Response.Write "QQ1 contains '" & QQ1 & "' "
sSQL = "UPDATE ECuryear SET Q1= '" & QQ1 & "' where (empid ='" & strID
& "')"
Response.Write "sSQL contains '" & sSQL & "' "
NEXT
%>
--
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"
Re: Help with Updating Multiple Records via Looping
am 27.12.2006 23:15:44 von pmarisole
Bob Barrows [MVP] wrote:
> Bob Barrows [MVP] wrote:
> >
> > <%
> > Dim strID, QQ1
> > count = Request.Form("x") - 1
> > Response.Write "count contains '" & count & "' "
> > for i = 0 to (count)
> > Response.Write "i contains '" & i & "' "
> > strID = Request.form("Emp & " i " &"'")
> > Response.Write "strID contains '" & strID & "' "
> > QQ1= Request.form("Q1 & " i " &"'")
> > Response.Write "QQ1 contains '" & QQ1 & "' "
> > sSQL = "UPDATE ECuryear SET Q1= '" & QQ1 & "' where (empid ='" & strID
> > & "')"
> > Response.Write "sSQL contains '" & sSQL & "' "
> > NEXT
> > %>
>
> actually, it should look like this:
>
> <%
> Dim key, strID, QQ1
> For Each key in Request.Form
> Response.Write "Request.Form(key) contains '" & _
> Request.Form(key) & "' "
> Next
> count = Request.Form("x") - 1
> Response.Write "count contains '" & count & "' "
> for i = 0 to (count)
> Response.Write "i contains '" & i & "' "
> strID = Request.form("Emp & " i " &"'")
> Response.Write "strID contains '" & strID & "' "
> QQ1= Request.form("Q1 & " i " &"'")
> Response.Write "QQ1 contains '" & QQ1 & "' "
> sSQL = "UPDATE ECuryear SET Q1= '" & QQ1 & "' where (empid ='" & strID
> & "')"
> Response.Write "sSQL contains '" & sSQL & "' "
> NEXT
> %>
>
> --
> 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"
Thanks for the response but when I used the code above this is the
response I got.
Microsoft VBScript compilation error '800a03ee'
Expected ')'
/EAP/QSUpdated.asp, line 21
strID = Request.form("Emp & " i " &"'")
------------------------------^
Re: Help with Updating Multiple Records via Looping
am 28.12.2006 00:03:02 von reb01501
pmarisole wrote:
> Thanks for the response but when I used the code above this is the
> response I got.
>
> Microsoft VBScript compilation error '800a03ee'
>
> Expected ')'
>
> /EAP/QSUpdated.asp, line 21
>
> strID = Request.form("Emp & " i " &"'")
> ------------------------------^
Well, I'm surprised you didn't get this error in the first place because I
essentially copied your code. The line should look like this, of course:
strID = Request.form("Emp" & i )
--
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"
Re: Help with Updating Multiple Records via Looping
am 28.12.2006 00:05:08 von reb01501
pmarisole wrote:
> Thanks for the response but when I used the code above this is the
> response I got.
>
> Microsoft VBScript compilation error '800a03ee'
>
> Expected ')'
>
> /EAP/QSUpdated.asp, line 21
>
> strID = Request.form("Emp & " i " &"'")
> ------------------------------^
And my suggested code would be more helpful if it looked like this:
For Each key in Request.Form
Response.Write "Request.Form(""" & key & """) contains '" & _
Request.Form(key) & "' "
Next
--
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"
Re: Help with Updating Multiple Records via Looping
am 28.12.2006 17:18:38 von pmarisole
Bob Barrows [MVP] wrote:
> pmarisole wrote:
>
> > Thanks for the response but when I used the code above this is the
> > response I got.
> >
> > Microsoft VBScript compilation error '800a03ee'
> >
> > Expected ')'
> >
> > /EAP/QSUpdated.asp, line 21
> >
> > strID = Request.form("Emp & " i " &"'")
> > ------------------------------^
>
> And my suggested code would be more helpful if it looked like this:
> For Each key in Request.Form
> Response.Write "Request.Form(""" & key & """) contains '" & _
> Request.Form(key) & "' "
> Next
>
> --
> 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"
I added your code as follows:
<%
Dim
strID,QQ1,QQ2,QQ3,QQ4,QQ5,QQ6,QQ7,QQ8,QQ9,QS,FYVar,count,i,s SQL,Conn5S,key
'*********************************************************** ******************
Set Conn5S = Server.CreateObject("ADODB.Connection")
Conn5S.Open "Provider=sqloledb;Data
Source=ebs-sqlc1-vs3.edn.runi.com\SSS;UID=casuser;PWD=hppcca s;DATABASE=skills"
THIS IS THE REPONSE I GET....... It shows the value of the fields when
I loop through
the key but when I call the field QQ1= Request.form("Q1" & i), I
don't get the value to add to the database. What could be wrong?
Re: Help with Updating Multiple Records via Looping
am 28.12.2006 17:29:06 von reb01501
pmarisole wrote:
> THIS IS THE REPONSE I GET....... It shows the value of the fields
> when I loop through
> the key but when I call the field QQ1= Request.form("Q1" & i), I
> don't get the value to add to the database. What could be wrong?
>
> Request.Form("Emp_1") contains '223851'
> Request.Form("Q1_1") contains '3'
Well, what do you get when you do this when i contains 1:
Response.Write "'" & "Q1" & i & "'"
Run it and see. I'll bet you don't see 'Q1_1' do you? You probably see
'Q11'
The solution is to change
QQ1= Request.form("Q1" & i)
to
QQ1= Request.form("Q1_" & i)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Re: Help with Updating Multiple Records via Looping
am 04.01.2007 18:32:28 von pmarisole
Bob Barrows [MVP] wrote:
> pmarisole wrote:
> > THIS IS THE REPONSE I GET....... It shows the value of the fields
> > when I loop through
> > the key but when I call the field QQ1= Request.form("Q1" & i), I
> > don't get the value to add to the database. What could be wrong?
> >
> > Request.Form("Emp_1") contains '223851'
> > Request.Form("Q1_1") contains '3'
>
> Well, what do you get when you do this when i contains 1:
>
> Response.Write "'" & "Q1" & i & "'"
>
> Run it and see. I'll bet you don't see 'Q1_1' do you? You probably see
> 'Q11'
> The solution is to change
> QQ1= Request.form("Q1" & i)
> to
> QQ1= Request.form("Q1_" & i)
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
Thanks so much, It works as you said.
Re: Help with Updating Multiple Records via Looping
am 04.01.2007 18:32:31 von pmarisole
Bob Barrows [MVP] wrote:
> pmarisole wrote:
> > THIS IS THE REPONSE I GET....... It shows the value of the fields
> > when I loop through
> > the key but when I call the field QQ1= Request.form("Q1" & i), I
> > don't get the value to add to the database. What could be wrong?
> >
> > Request.Form("Emp_1") contains '223851'
> > Request.Form("Q1_1") contains '3'
>
> Well, what do you get when you do this when i contains 1:
>
> Response.Write "'" & "Q1" & i & "'"
>
> Run it and see. I'll bet you don't see 'Q1_1' do you? You probably see
> 'Q11'
> The solution is to change
> QQ1= Request.form("Q1" & i)
> to
> QQ1= Request.form("Q1_" & i)
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.