iTech College - Internet Technology, Online Education, E-Learning, Technician Training, Tech Tutorials, Distance Education, Virtual Learning XML Course: Create an XML File From a Database (1) - www.itechcollege.com XML Course: Create an XML File From a Database (1) - www.itechcollege.com
Free Courses
HTML
JavaScript
CSS
ASP
PHP
JSP
C++
ASP.NET
SQL
AJAX
FTP
XML

courses > XML > Create an XML File From a Database (1)

Create an XML File From a Database (1)

XML can be generated by using server-side scripts. For example, you can select data from your database, and use the data to generate an XML file. The following is an example of how to use ASP to create an XML file:

<%
response.ContentType = "text/xml"
set conn=Server.CreateObject("ADODB.Connection")
conn.provider="Microsoft.Jet.OLEDB.4.0;"
conn.open server.mappath("mydb.mdb")

sql="select * from customers"
set rs=Conn.Execute(sql)

response.write("<?xml version='1.0' encoding='ISO-8859-1'?>")
response.write("<customerlist>")
while (not rs.EOF)
response.write("<customer>")
response.write("<firstname>" & rs("firstname") & "</firstname>")
response.write("<lastname>" & rs("lastname") & "</lastname>")
response.write("<address>" & rs("address") & "</address>")
response.write("<city>" & rs("city") & "</city>")
response.write("<state>" & rs("city") & "</state>")
response.write("<zip>" & rs("zip") & "</zip>")
response.write("<email>" & rs("email") & "</email>")
response.write("<phone>" & rs("phone") & "</phone>")
response.write("</customer>")
rs.MoveNext()
wend

rs.close()
conn.close()
response.write("</customerlist>")
%>



  Back to Index Page
 Next Page:  

XML Introduction
XML Format and Structure
XML Elements
XML Attributes
XML Syntax 1
XML Syntax 2
XML Naming Rules and Practices
XML Using CDATA for Dealing with HTML Tags
Displaying XML into HTML
XML Parser
XML DOM
XMLHttpRequest Object 1
XMLHttpRequest Object 2
XMLHttpRequest Object 3
Create an XML File From a Database 1
Create an XML File From a Database 2
Save XML File on Server


Online Education, Online Training for Your Job, Distance Education, E-learning Programs for Your Career!Online Colleges, Online Universities, E-learning & Distance Education for Your Career! Easy Job Training & Online Courses.


   Email A Friend  
 
Earn Online Degree
for Your Job
I found a job after I earned an online degree!
Online classes for finding a Job. Online College, Online University, Degrees, E-learning school, online certificate Earn your
online degree now!
Online Training
for Good Job
Why I work so hard but earn so little? Why I cannot find a high paying job?
Online training for a Good Jobs. Online Degree, E-learning school, online certificate Go to
online school now!

Copyright ©2024, itechcollege.com. All rights reserved
iTechCollege | About iTech | Contact iTech