|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
using multiple select
The problem I am having, is when it gets to the asp page. If I click 1 name, it will process. But multiple names gives me an error: Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /GIG/ladder/reportasp2_new.asp, line 53 that line's code is set rsID2 = conn.execute ("select total_score from rounds where username = '" & var1 & "'") var11 = rsID2.fields.item("total_score").value what appears to be happening, is it isn't picking up all the names. on the asp page, i begin the code with this. For Each Item In Request.QueryString("username") and have a NEXT at the end of the code. this is using access db i don't know what i am missing If i do a response.write it gives the names twice for some reason. i made a dummy page, just to see how the names are getting sent, but they are getting repeated. this is the code <% Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open (MM_connection_STRING) %> <% For Each Item In Request.QueryString("username") var1 = Request.querystring("username") 'first player var2 = Request.querystring("username1") 'person reporting response.write var1 if UCASE(var1) = UCASE(var2) then response.redirect "report_self.asp" else end if Next Conn.Close Set Conn = Nothing 'response.redirect "current.asp" %> test it here to see what i mean http://www.gig-gamers.com/GIG/ladder/report_new.asp can anyone help?? I even made it real simple. i put this as the code
For Each item In Request.QueryString("username") Response.Write Request.QueryString("username")& "<BR>" and it is still doubling the results.Show quote "Jeff" <gig_***@adelphia.net> wrote in message news:xsWdnWck_KKzeofZnZ2dnUVZ_s2dnZ2d@adelphia.com... > Hey gang. I have a form to select multiple names. > The problem I am having, is when it gets to the asp page. If I click 1 > name, it will process. But multiple names gives me an error: > Either BOF or EOF is True, or the current record has been deleted. > Requested operation requires a current record. > /GIG/ladder/reportasp2_new.asp, line 53 > > that line's code is > > set rsID2 = conn.execute ("select total_score from rounds where username = > '" & var1 & "'") > var11 = rsID2.fields.item("total_score").value > > what appears to be happening, is it isn't picking up all the names. > > on the asp page, i begin the code with this. > > For Each Item In Request.QueryString("username") and have a NEXT at the > end of the code. > > this is using access db > > i don't know what i am missing > > If i do a response.write it gives the names twice for some reason. > i made a dummy page, just to see how the names are getting sent, but they > are getting repeated. this is the code > > <% > Set Conn = Server.CreateObject("ADODB.Connection") > Conn.Open (MM_connection_STRING) > %> > > <% > For Each Item In Request.QueryString("username") > var1 = Request.querystring("username") 'first player > var2 = Request.querystring("username1") 'person reporting > > > > response.write var1 > if UCASE(var1) = UCASE(var2) then > response.redirect "report_self.asp" > else > end if > > > > Next > > Conn.Close > Set Conn = Nothing > 'response.redirect "current.asp" > > > > > %> > test it here to see what i mean > > http://www.gig-gamers.com/GIG/ladder/report_new.asp > > can anyone help?? > > Jeff wrote on 17 mrt 2006 in microsoft.public.inetserver.asp.general:
> I even made it real simple. i put this as the code This looks strange, you want to write the collection object several > > For Each item In Request.QueryString("username") > Response.Write Request.QueryString("username")& "<BR>" > times? Shouldn't it be: For Each X In Request.QueryString("username") Response.Write X & "<BR>" Next ============== But then: Request.QueryString() is not a collection but a string ALWAYS. So I suppose it contains a comma + space seperated string. Try this: ================ test.asp ==================== <% ' vbscript Response.Write request.querystring("q") & "<br>=======<br>" q=split(request.querystring("q"),", ")for i=0 to ubound(q) Response.Write q(i) & "<br>" next %> <form> <input type=checkbox name=q value=a checked> <input type=checkbox name=q value=b checked> <input type=checkbox name=q value=c checked> <input type=checkbox name=q value=d checked> <input type=checkbox name=q value=e checked> <input type=submit> </form> ==================================== -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) I got it to work. this is what I ended up doing
For I = 1 To Request.QueryString("username").Count that way it was counting, and only displaying each name once. thanks for the help Show quote "Evertjan." <exjxw.hannivo***@interxnl.net> wrote in message news:Xns9789C7F49326eejj99@194.109.133.242... > Jeff wrote on 17 mrt 2006 in microsoft.public.inetserver.asp.general: > >> I even made it real simple. i put this as the code >> >> For Each item In Request.QueryString("username") >> Response.Write Request.QueryString("username")& "<BR>" >> > > This looks strange, you want to write the collection object several > times? > > Shouldn't it be: > > For Each X In Request.QueryString("username") > Response.Write X & "<BR>" > Next > > ============== > > But then: > > Request.QueryString() is not a collection but a string ALWAYS. > > So I suppose it contains a comma + space seperated string. > > Try this: > > ================ test.asp ==================== > <% ' vbscript > > Response.Write request.querystring("q") & "<br>=======<br>" > > q=split(request.querystring("q"),", ") > > for i=0 to ubound(q) > Response.Write q(i) & "<br>" > next > > %> > <form> > <input type=checkbox name=q value=a checked> > <input type=checkbox name=q value=b checked> > <input type=checkbox name=q value=c checked> > <input type=checkbox name=q value=d checked> > <input type=checkbox name=q value=e checked> > <input type=submit> > </form> > ==================================== > > > -- > Evertjan. > The Netherlands. > (Please change the x'es to dots in my emailaddress) Jeff wrote:
> I got it to work. this is what I ended up doing Evertjan was right, though. In your original example, you were writing the > For I = 1 To Request.QueryString("username").Count > that way it was counting, and only displaying each name once. entire collection once per row. -- Dave Anderson Unsolicited commercial email will be read at a cost of $500 per message. Use of this email address implies consent to these terms. Please do not contact me directly or ask me to contact you directly for assistance. If your question is worth asking, it's worth posting. |
|||||||||||||||||||||||