1
我有一个SQL查询,它使用Do Until Loop从数据库检索值。 SQLCondition的循环中的值显示正确,但如果我想显示外循环的价值,这是行不通的:Response.Write to a 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
的回复于从循环显示“2,3,4内,5" 。但循环外的response.write显示“5”。
如何将该值从循环内部存储到查询以外使用的字符串中?