求好心人帮我解释下几行代码的意思,很快很简单
if Err.number = 0 then
if adoRecordset.BOF and adoRecordset.EOF then
Response.Write "<root number=""0""></root>"
else
dim responseStr
responseStr = ""
do while not adoRecordset.EOF
responseStr = responseStr & adoRecordset.Fields(0).Value
adoRecordset.MoveNext
loop
Response.Write "<root number=""0"">" & responseStr & "</root>"
end if
这应该是asp的代码
if Err.number = 0 then //这里可能是产生分页的XML 0应该为第一页
if adoRecordset.BOF and adoRecordset.EOF then //ADO的对象Recordset读取记录 如果没有记录
Response.Write "<root number=""0""></root>" //输出字符串 <root number=""0""></root>
else
dim responseStr //定义变量 responseStr
responseStr = "" //赋值变量 responseStr
do while not adoRecordset.EOF //如果有记录 do while循环
//赋值变量responseStr adoRecordset.Fields(0).Value 应该记录集第一个字段的值(这种写法倒没见过)
responseStr = responseStr & adoRecordset.Fields(0).Value
adoRecordset.MoveNext //指向下一条记录
loop //循环
Response.Write "<root number=""0"">" & responseStr & "</root>" 输出字符串
end if