GENERATION DE XML VIA ASP

jaszbere Messages postés 9 Date d'inscription samedi 12 avril 2003 Statut Membre Dernière intervention 26 avril 2003 - 13 avril 2003 à 03:15
jaszbere Messages postés 9 Date d'inscription samedi 12 avril 2003 Statut Membre Dernière intervention 26 avril 2003 - 13 avril 2003 à 03:15
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/8783-generation-de-xml-via-asp

jaszbere Messages postés 9 Date d'inscription samedi 12 avril 2003 Statut Membre Dernière intervention 26 avril 2003
13 avril 2003 à 03:15
Salut intoX!

Merci pour ce code merveilleur!
Je l'ai modifie pour que ca marche sur ma machine, mais il y a encore des problemes. je veux que chaque fois que j'appele mon page asp pour different clients le code genere un fichier .xml unique qui correspond a son username!

voici mon code:

<html>

<% @Language = "VBScript" %>

<%
response.ContentType = "text/xml"
set conn=Server.CreateObject("ADODB.Connection")
conn.provider="Microsoft.Jet.OLEDB.4.0;"
conn.open server.mappath("sample.mdb")
sql="select * from Sample"
set rs=Conn.Execute(sql)
'rs.MoveFirst()

set newFileObject = Server.CreateObject("Scripting.FileSystemObject")
set newFile = newFileObject.CreateTextFile("C:Inetpubwwwroot" & "test2.xml")
newFile.Writeline("<guestbook>")
Do While Not rs.EOF
newFile.Writeline("<client>")
newFile.Writeline(" " & rs("ID") & " ")
newFile.Writeline("<Name>" & rs("Name") & "</Name>")
newFile.Writeline("<City>" & rs("City") & "</City>")
newFile.Writeline("<State>" & rs("State") & "</State>")
newFile.Writeline("<Country>" & rs("Country") & "</Country>")
newFile.Writeline("</client>")
rs.MoveNext()
loop
rs.close()
conn.close()
newFile.Writeline("</guestbook>")
newFile.Close
if newFileObject.FileExists("C:Inetpubwwwroot estxml.xml") then
Response.Write("création ok!")
end if
set newFile = Nothing
set newFileObject = Nothing
set conn = Nothing
%>

</html>

Si tu veux m'aide ecrire moi s'il tu plait!
Merci beaucoup!
Rejoignez-nous