469,333 Members | 4,661 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,333 developers. It's quick & easy.

Mssql To Xml

Hello I have tryed to store the data from my db in a XML File But it doesnt create the File and it says Data Time Out:-(
Ps have just Searched on this Forum but there is nothing that helps me out mybe can help me anyone?
Here is the Code:
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.  
  4.  
  5. <html>
  6.  
  7.  
  8.  
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  11. <title>Neue Seite 1</title>
  12. </head>
  13.  
  14. <body>
  15.  
  16. <%
  17.     Dim conn
  18.     Dim rs
  19.  
  20.    Set conn = server.createObject("ADODB.Connection")
  21.     on Error Resume Next
  22.     SSN = Request.QueryString("SSN")
  23.     ' Verbindung zur Datenbank herstellen
  24.     conn.open "PROVIDER=SQLOLEDB;SERVER=123;ADDRESS=212,1234;UID=werer;PWD=666;DATABASE=MydB;"
  25.  
  26.    set rs=Server.CreateObject("ADODB.recordset")
  27.  
  28.    rs.Open "SELECT * FROM Betriebsdaten for XML", conn 
  29.      do until rs.EOF
  30.     for each x in rs.Fields
  31.      Response.Write(x.name)
  32.      Response.Write(" = ")
  33.      Response.Write(x.value & "<br />") 
  34.    next
  35.    Response.Write("<br />")
  36.    rs.MoveNext
  37.   loop
  38.  
  39.  rs.close
  40.  conn.close
  41. %>    
  42.  
  43. </body>
  44.  
  45. </html>
Oct 26 '07 #1
2 1878
jhardman
3,406 Expert 2GB
Right, so there are a couple ways to do this. I tend toward the do-it-yourself end of the spectrum, put the data into a long string including XML tags and save it to a text file using the textStream and fileSystemObject. That's how we had to do it back in my day when we used to have to write our code in clay with mallets and wait for some flunky with an abacus to render webpages.

Nowadays there is an XML server object provided, but I haven't used it to save XML files, and I would have to look it up to get it right. Since I know the syntax of the XML file it is just easier for me to write it by hand than rely on the server object.

Jared
Oct 27 '07 #2
hi Thx for reply u can maybe make me an example=?
Oct 29 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by badz | last post: by
7 posts views Thread by mj | last post: by
14 posts views Thread by Kukurydz | last post: by
11 posts views Thread by ralphie | last post: by
8 posts views Thread by php-taz | last post: by
14 posts views Thread by guswebb | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.