Robson,
Just add the "x" to "asp", .Net Framework can run it.
Hope it helps
Eduardo
[quoted text, click to view] "Robson Carvalho Machado" <RobsonCarvalhoMachado@discussions.microsoft.com> wrote in message news:<00BB018E-4FA5-4386-86A2-95F4556C857F@microsoft.com>...
> Dear Friends,
> I was using the below code in ASP to dynamically generate XML from a SQL Query
> Does anyone knows how can I migrate this code to VB and ASPX?
>
> Regards
> Robson Machado
>
> Response.ContentType = "text/xml"
> Response.Write "<?xml version='1.0' ?>"
> dim RS, CN
> set CN = server.CreateObject("adodb.connection")
> set RS = server.CreateObject("adodb.recordset")
> CN.ConnectionString = strConnect
> CN.Open
> RS.Open SQLStmt,cn
> Response.Write "<ROOT>"
> Response.Write RS2XML(RS,"RESULT")
> Response.Write "</ROOT>"
> CN.close
> set rs = nothing
> set cn = nothing
> function RS2XML(rs, ChildNode)
> dim Field
> if rs is nothing then exit function
> ChildNode = ucase(ChildNode)
> if rs.eof then
> RS2XML = ""
> exit function
> end if
> do until rs.eof
> if ChildNode <> "" then RS2XML = RS2XML & "<" & ChildNode & ">"
> for each field in rs.fields
> RS2XML = RS2XML & " <" & ucase(field.name) & ">" &
> server.HTMLEncode(NotNull(field.value)) & "</" & ucase(field.name) & ">"
>
> next
> if ChildNode <> "" then RS2XML = RS2XML & "</" & ChildNode & ">"
> rs.movenext
> loop
> end function
> Function NotNull(vOrig)
> If(IsNull(vOrig)) then
> NotNull = ""
> else
> NotNull = vOrig
> end if