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

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Mon Aug 22 10:33:36 CDT 2005


> where 'foo' is the name of a number of checkboxes, 
> and classic ASP will return you a Collection

	It won't return a collection, but it *will* return a
comma-delimited string of all selected checkboxes...

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Matt Warden

Brian,

Brian Cummiskey wrote:
> I split it all out into a nice string...
> 
> for i = 1 to Request.Form.Count
>   if (inStr(1,Request.Form.Key(i),"recordid")) then

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')

where 'foo' is the name of a number of checkboxes, and classic ASP will
return you a Collection. So, you should be able to simplify your code
and avoid the for loop.

>     totalNumbers = totalNumbers + 1
>     if (numbersToNotCall = "") then
>       numbersToNotCall = "'" & Request.Form.Item(i) & "'"
>     else
>       numbersToNotCall = numbersToNotCall & ",'" & 
> Request.Form.Item(i) & "'"
>     end if
...
> Anyone have any suggestions on how to approach the multiple updates 
> across multiple servers in multiple locations?

Use different connection objects.

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.

Thanks,

- --
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com





More information about the thelist mailing list