using multiple select

J

Jeff

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??
 
J

Jeff

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.
 
E

Evertjan.

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>
====================================
 
J

Jeff

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
 
D

Dave Anderson

Jeff said:
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.

Evertjan was right, though. In your original example, you were writing the
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top