Instead of for each, you need to use a numeric indexer intoto access the collection. The latter preserves the order of the input string.
<%
Dim qstr
Dim count: count = 0
Dim x
Dim value
for x = 1 To Request.Querystring.Count
value = Request.Querystring.Item(x)
If value <> ",EMPTY" Then
qstr = qstr & "&s" & count & "=" & value
count = count + 1
End If
Next
If qstr <> "" Then
qstr = Right(qstr, Len(qstr) - 1)
End If
Response.Write "<p>Input:<br />" & Request.Querystring & "</p>"
Response.Write "<p>Output:<br />" & qstr & "</p>"
%>
Input:
s0=Columbus,OH&s1=,EMPTY&s2=,EMPTY&s3=Chicago,IL&s4=,EMPTY&s5=,EMPTY&s6=,EMPTY&s7=,EMPTY&s8=Akron,OH&s9=,EMPTY&s10=,EMPTY&s11=Plainfield,IN&s12=,EMPTY&s13=Miami,FL&s14=,EMPTY&s15=,EMPTY&s16=,EMPTY&s17=,EMPTY&s18=,EMPTY&s19=,EMPTY&s20=,EMPTY&s21=Memphis,TN&s22=Denver,CO&s23=Dallas,TX
Output:
s0=Columbus,OH&s1=Chicago,IL&s2=Akron,OH&s3=Plainfield,IN&s4=Miami,FL&s5=Memphis,TN&s6=Denver,CO&s7=Dallas,TX