' now move in one level
intLevel = intLevel + 1
strSpace = space (intLevel * 2)
' loop through the records
dim strTemp
FrstRst.MoveFirst
do while not FrstRst.EOF
strTemp = ""
'loop through the fields
'strXML = strXML & strSpace & "<Record"
for each objField in FrstRst.Fields
'set objField = FrstRst.Fields(intRstField)
strTemp = strTemp & space (1) & objField.Name & "="
strTemp = strTemp & """" & ReplaceChar(objField.Value) & """"
end if
next
strXML = strXML & "<Record "&strTemp& "/" & vbCR
FrstRst.MoveNext
loop
intLevel=intLevel-1
strSpace=space(intLevel * 2)
if Len(FstrRstName)0 then
strXML = strXML & strSpace & "</" & FstrRstName & "" & vbCR
end if
RstToXML = strXML
end function
getInfo.asp
========================================
猜你喜欢