У меня есть SQL-запрос, который извлекает значения из базы данных с помощью Do Do not Loop. Значение SQLCondition внутри цикла отображается правильно, но если я хочу, чтобы отобразить значение вне цикла, он не работает:Response.Write to String - ASP Classic
If rReseller > 0 Then
sql2 = "SELECT rl.countryid FROM reseller_locator rl WHERE rl.resellerid = " & rReseller & " AND rl.countryid <> '" & iCountryID & "'"
'response.write sql2
Set rsResellerLocator=Conn.Execute(sql2)
If not rsResellerLocator.EOF Then
do until rsResellerLocator.eof
iRCountryID = rsResellerLocator("countryid")
SQLCondition = iRCountryID & ", "
response.write SQLCondition
rsResellerLocator.movenext
loop
Else
SQLCondition = ""
End If
response.write SQLCondition
End If
response.write внутри дисплеев цикла «2,3,4 , 5" . Но response.write извне цикла отображает «5».
Как сохранить это значение из цикла в строку, которая будет использоваться вне запроса?