有人提供的代码如下,但是有错误。还有不有更好的办法?
Set Rs1= Server.CreateObject("adodb.recordset"

Set Rs2= Server.CreateObject("adodb.recordset"

Set Rs3= Server.CreateObject("adodb.recordset"

'SQL="Select username,province,city from [Dv_User] where city<>"""" and province<>"""" Order by province,city desc"
SQL="Select distinct province from [Dv_User] where city<>"""" and province<>"""""
rs1.open sql,conn
while not rs1.eof
response.write(rs1(0)&" "

SQL="Select distinct city from [Dv_User] where province='"&rs1(0)&"'and city<>"""""
rs2.open sql,conn,1,1
while not rs2.eof
response.write(rs2(0)&" "

SQL="Select username from [Dv_User] where city='"&rs2(0)&"' and province='"&rs1(0)&"'"
rs3.open sql,conn,1,1
while not rs3.eof
response.write(rs3(0)&" "

rs3.movenext:wend
rs2.movenext:wend
rs1.movenext:wend