Connecting Tech Pros Worldwide Forums | Help | Site Map

asp to xml sheet

Familiar Sight
 
Join Date: Jul 2007
Location: United Kingdom
Posts: 203
#1: Apr 10 '08
Hi

i'm trying to find some code that can genrate asp result to xml sheet

My xml version is <?xml version="1.0" encoding="utf-8" standalone="yes"?>

Expand|Select|Wrap|Line Numbers
  1. <%
  2. response.ContentType = "text/xml"
  3. set conn=Server.CreateObject("ADODB.Connection") 
  4. conn.provider="Microsoft.Jet.OLEDB.4.0;"
  5. conn.open server.mappath("/db/database.mdb")sql="select fname,lname from tblGuestBook"
  6. set rs=Conn.Execute(sql)response.write("<?xml version='1.0' encoding='ISO-8859-1'?>")
  7. response.write("<guestbook>")
  8. while (not rs.EOF)
  9.   response.write("<guest>")
  10.   response.write("<fname>" & rs("fname") & "</fname>")
  11.   response.write("<lname>" & rs("lname") & "</lname>")
  12.   response.write("</guest>")
  13.   rs.MoveNext()
  14. wendrs.close()
  15. conn.close()
  16. response.write("</guestbook>")
  17. %>
  18.  
thanks in advance

DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 930
#2: Apr 10 '08

re: asp to xml sheet


Hi Fary4u,

I've tested your code and the xml content doesn't display in IE. In FireFox however it works fine! Can you give that a try please and let me know if it works for you also?

I'll try and look into this one a bit further.

Dr B
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#3: Apr 11 '08

re: asp to xml sheet


you should be able to validate your XML with the W3C, just to make sure there are no errors.

Jared
DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 930
#4: Apr 14 '08

re: asp to xml sheet


Fary4u, did you ever get this fixed? I'd be interested to know what the problem was if you did.

If not, did you ever try it in FireFox?

Best Regards,

Dr B
Familiar Sight
 
Join Date: Jul 2007
Location: United Kingdom
Posts: 203
#5: Nov 4 '08

re: asp to xml sheet


Yep i've done it & getting record from the database write xml sheet before saving it into the database.

it's working fine there was no problem i'm using this wd Flash components to access records 1 after another.
Reply


Similar ASP / Active Server Pages bytes