begin process at 2012 02 05 04:07:42
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

XML

 > CONVERTION DE JEUX D'ENREGISTREMENTS ADO AU FORMAT XML

CONVERTION DE JEUX D'ENREGISTREMENTS ADO AU FORMAT XML


 Information sur la source

Note :
1 / 10 - par 1 personne
1,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :XML Niveau :Débutant Date de création :06/05/2002 Date de mise à jour :07/05/2002 13:29:26 Vu :7 973

Auteur : Skyride

Ecrire un message privé
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Ce petit bout de code vous permettra de générer un fichier XML à partir de données contenues dans un objet de type recordset  

Source

  • <%
  • strConnection = "ICI VOTRE CHAINE DE CONNECTION"
  • Set objConnection = Server.CreateObject("ADODB.Connection")
  • objConnection.Open strConn
  • SQLQuery = "SELECT * FROM TABLE"
  • Set RS = objConnection.Execute(SQLQuery)
  • RS.save Server.MapPath("/essai.xml"), 1
  • RS.close
  • set RS = nothing
  • objConnection.close
  • set objConnection = nothing
  • %>
<%
	strConnection = "ICI VOTRE CHAINE DE CONNECTION"
	
	Set objConnection = Server.CreateObject("ADODB.Connection") 
   	objConnection.Open strConn
   
   SQLQuery = "SELECT * FROM TABLE"
   Set RS = objConnection.Execute(SQLQuery)

	RS.save Server.MapPath("/essai.xml"), 1

   RS.close
   set RS = nothing
   
   objConnection.close
   set objConnection = nothing

%>  



 Sources du même auteur

COMPOSANT ASPMAIL PILOTÉ VIA SQL SERVER
Source .NET (Dotnet) LISTER LES DOSSIERS D'UN RÉPERTOIRE
Source .NET (Dotnet) LISTER LES FICHIERS D'UN RÉPERTOIRE
Source .NET (Dotnet) INFORMATIONS D'UN FICHIER
Source avec Zip Source .NET (Dotnet) GÉNÉRER UN DOCUMENT HTML À PARTIR DE DONNÉES CONTENUES DANS ...

 Sources de la même categorie

AJOUTER UN NOEUD DANS UN FICHIER XML DÉJÀ EXISTANT par pkzip
BASE DE DONNÉ BDD VERS XML : CONVERSION D'UN RECORDSET VERS ... par pifou25
Source .NET (Dotnet) GÉNÉRATION D'UN XML À PARTIR D'UNE BDD ACCESS par fabienfs
Source avec Zip LECTEUR DE FLUX RSS OBJET par Yoyo2B
Source avec Zip Source .NET (Dotnet) TRANSFORMATION XSLT POUR OBTENIR DU CODE XTML VALIDE À INTÉG... par saizonou

Commentaires et avis

Commentaire de Mercury le 07/05/2002 11:06:21

Ton ne enregistre simplement le contenu d'un RECORDSET dans un fichier texte portant l'extension .XML. En aucun cas il ne permet de générer un "vrai" fichier XML.

Commentaire de bubblepwal le 03/07/2003 20:48:02

Lu tt le monde,

Là j'ai un doute ... si ça c'est pas du xml ...!

&lt;xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'&gt;
&lt;s:Schema id='RowsetSchema'&gt;
&lt;s:ElementType name='row' content='eltOnly'&gt;
&lt;s:AttributeType name='id' rs:number='1'&gt;
&lt;s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true' rs:maybenull='false'/&gt;
&lt;/s:AttributeType&gt;
&lt;s:AttributeType name='actu' rs:number='2' rs:nullable='true' rs:write='true'&gt;
&lt;s:datatype dt:type='string' dt:maxLength='50'/&gt;
&lt;/s:AttributeType&gt;
&lt;s:AttributeType name='titre' rs:number='3' rs:nullable='true' rs:write='true'&gt;
&lt;s:datatype dt:type='string' dt:maxLength='50'/&gt;
&lt;/s:AttributeType&gt;
&lt;s:AttributeType name='url' rs:number='4' rs:nullable='true' rs:write='true'&gt;
&lt;s:datatype dt:type='string' dt:maxLength='50'/&gt;
&lt;/s:AttributeType&gt;
&lt;s:AttributeType name='target' rs:number='5' rs:nullable='true' rs:write='true'&gt;
&lt;s:datatype dt:type='string' dt:maxLength='50'/&gt;
&lt;/s:AttributeType&gt;
&lt;s:extends type='rs:rowbase'/&gt;
&lt;/s:ElementType&gt;
&lt;/s:Schema&gt;
&lt;rs:data&gt;
&lt;z:row id='1' actu='Pwet pwet pwal' titre='titre 1' url='pwet/' target='_self'/&gt;
&lt;z:row id='2' actu='Pwet pwet pwal 2' titre='titre 2' url='pwal/' target='_self'/&gt;
&lt;z:row id='3' actu='Pwet pwet pwal 3' titre='titre 3' url='prout/' target='_self'/&gt;
&lt;/rs:data&gt;
&lt;/xml&gt;

mais juste une couille :( quand j'essai de le récupérer dans dans objet DOM ça me dit que le fichier existe déjà ... mmm.
comment je pourrais le faire rentrer (dans l'objet DOM), un cast ??
... need help plz

&lt;%
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open "actu"
SQL = "SELECT * FROM actualite order by Id"
Set rs = OBJdbConnection.Execute(SQL)

Set XMLDoc = Server.CreateObject("Microsoft.XMLDOM")
Set XSLDoc = Server.CreateObject("Microsoft.XMLDOM")

XMLDoc.load(Server.MapPath("actual.xml"))
XMLDoc.async = false

rs.Save Server.MapPath(XMLDoc), 1  
'marche po :(

  rs.Save Server.MapPath("actual.xml"), 1
  XMLDoc.load(Server.MapPath("actual.xml"))
  'ça sa marche par contre mais ça créer physiquement le fichier alors si il existe déjà ça couine ...

XSLDoc.async = false
XSLDoc.load(Server.MapPath("actu.xsl"))
                                          
response.write(XMLDoc.documentElement.transformNode(XSLDoc.documentElement))

rs.close
set rs = nothing
%&gt;

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,764 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales