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

Brian Cummiskey Brian at hondaswap.com
Mon Aug 22 09:15:06 CDT 2005

I'm working on parsing a form with a checkbox array passed into the 
processor page.

the form is setup as follows:

<input type="checkbox" id="recordid" name="recordid" 
value="rowID,JobName,ServerName" />

The purpose of this form is to pass in particular records from all jobs 
and all servers on my wan for which to update selected records.

The form is populated properly with the variables from the select.

When I select a check box and pass it on to the next page is where i'm 
having my problem.

I need to run an update, structured like:

update ServerName.dbo.Database.JobName set status = 'U' where rowid = 
'"& rowid & "'"

This would be easy, if it weren't for the fact that its a check box-- 
and thus, there can be tons of records passed through.

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
     totalNumbers = totalNumbers + 1
     if (numbersToNotCall = "") then
       numbersToNotCall = "'" & Request.Form.Item(i) & "'"
       numbersToNotCall = numbersToNotCall & ",'" & Request.Form.Item(i) 
& "'"
     end if
   end if

but i seem to not be getting anywhere.

Anyone have any suggestions on how to approach the multiple updates 
across multiple servers in multiple locations?

More information about the thelist mailing list