[thelist] stuck in a loop (classic asp/mssql)

Brian Cummiskey Brian at hondaswap.com
Mon Aug 22 10:42:44 CDT 2005

Matt Warden wrote:

> It has been a *long* time since I've done any serious ASP work, but I
> am fairly certain that you can do:
> foo = Request.Form('foo')

yes, this works, but it leaves me with a foo variable that looks like:

0001810160665071,MRF70TO73,MBC2, 0001850170665070,MRF70TO73,MBC2, 
000717033,LT_5077,MBC2, 000821090,OPT5171,MBC2

when i have 4 check boxes selected.  you can easily see the rowid (the 
number), the jobname (ABC_1234), and the server, MBC2 in this case.

> Use different connection objects.

I'm not sure what you mean by this.

 > Can you give us a little more information on exactly what the problem
 > you're experiencing is? I know you said you aren't really getting
 > anywhere, but where are you currently and where do you want to be?
 > What is the above code not doing that you want it to do, basically.

Basically, what I want to do is to call one stored procedure that is 
mirrored on each server in the same DB name.

if server = MBC2 then
	' call sp_ here
	' pass in jobname and rowid
end if

my problem is splitting out the comma delimitted list, to pass in the 
server, jobname, and rowid's to the proper place.

I've tried:

for x = 1 to Request.Form.Count
	if x MOD 3 = 0 then
		site = Request.Form.Item(x)
	end if

	if x MOD 3 = 1 then
		theserver = Request.Form.Item(x)
	end if

	if x MOD 3 = 2 then
		job = Request.Form.Item(x)
	end if


but this has proved un predictable, placing jobs in site, sites in row 
ids, and so forth.  the first seems to work, but every row after is not 
the same modulus it seems.

So the jist of my problem is:

I need to take the given 3 var string of rowid, job, servername
and split it out into the proper places for the stored procedure.
and if more than 1 check box is checked, i need to loop through and 
perform the steps each time.

More information about the thelist mailing list