Export to XML format (Db2Xml)     

Db2Xml allows you to export all the data from one or all tables in a database
in XML format. Db2Xml writes the output by default to 'table.xml' unless you
specify with the '-o' option a different output file.
Db2Xml also create the XML DTD file "table.dtd" referenced from "table.xml"
unless you specify the "-n" option to write the XML without the DTD.reference.
If you don't specify a table with the "-t" option Db2Xml will export all tables.
Db2Xml writes all diagnostics to a log file "logs/yyyymmdd/db2xml.log"
The exported XML data can be transmitted to other clients or imported to any
other database with the DbLoad utility.
Note that In demo mode up to 100 records can be exported.

Unless you have a XML editor we suggest the free Microsoft XML Notepad (backup)

-usage: db2xml [-sn] [-d{db}] [-o{out}] [-t{tab}]
-d = DATABASE: Specify database input file (default Sample.mdb)
-o = OUTPUT  : Specify output filename (default Table.{xml|txt|csv|htm})
                 -o STDOUT writes directly to standard output not a file
-t = TABLE   : Specify Table name (default is all tables)
                 or table number ('#3' = 3rd table)
-s = SILENT  : Dont show diagnostics (XX Records written..)
-n = NOHEADER: Dont write DTD (XML), header line (TXT, CSV, HTML)

db2xml -d Sample.mdb -t Employees -o emp.XML
9 'Employees' Record(s) written to 'emp.xml'

Exports all data from the " Employees" table from database "Sample.mdb".
The output is written to "emp.XML" and the XML DTD file to "emp.DTD"

Example XML Output (emp.xml)
<?xml version="1.0"?>
<!-- Database Location: Sample.mdb -->
<!DOCTYPE Sample SYSTEM "emp.dtd">
<ROOT Database="Sample.mdb">
        <Title>Sales Representative</Title>
        <Address>507 - 20th Ave. E.&#x0D;&#x0A;Apt. 2A</Address>
        <HomePhone>(206) 555-9857</HomePhone>
        <Photo>Array of VT_UI1</Photo>
        <Notes>Education includes a BA in psychology from Colorado State University in 1970. She also completed &quot;The Art of the Cold Call.&quot; Nancy is a member of Toastmasters International.</Notes>
        <Title>Vice President, Sales</Title>
        <Address>908 W. Capital Way</Address>
        <HomePhone>(206) 555-9482</HomePhone>
        <Photo>Array of VT_UI1</Photo>
        <Notes>Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager in January 1992 and to vice president of sales in March 1993. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.</Notes>

XML DTD Data description (emp.dtd):
<!-- Database Location: Sample.mdb -->
<!-- .DTD file generated by DbTkXml (Version 1.2a) (C) Copyright 2000-2002 B. Eichberger http://www.ProfSoftware.com -->
<!ELEMENT Sample (Employees)+>
<!ELEMENT Employees (EmployeeID,LastName,FirstName,Title,TitleOfCourtesy,BirthDate,HireDate,Address,City,Region,PostalCode,Country,HomePhone,Extension,Photo,Notes,ReportsTo)>
<!ELEMENT FirstName (#PCDATA)>
<!ELEMENT TitleOfCourtesy (#PCDATA)>
<!ELEMENT BirthDate (#PCDATA)>
<!ELEMENT Address (#PCDATA)>
<!ELEMENT PostalCode (#PCDATA)>
<!ELEMENT Country (#PCDATA)>
<!ELEMENT HomePhone (#PCDATA)>
<!ELEMENT Extension (#PCDATA)>
<!ELEMENT ReportsTo (#PCDATA)>

If you run this command on Feb 18th, 2001 the logfile would be created in:
INIT    |13:35:03.438 |====== Opening c:/dbtkxml/logs/20010218/db2xml.log ======
DbTkXml |13:35:03.549 |ExecCmd: opendb Sample.mdb
DbTkXml |13:35:03.599 |ExecCmd: table Employees
DbTkXml |13:35:03.619 |ExecCmd: XMLEXPORT emp.XML
DbTkXml |13:35:03.639 |9 'Employees' Record(s) written to 'emp.XML'

Table,Column,Field,Record,Index,Query,External Data,Save As,merge,synchronize,explorer,
command,line,batch scipts, shareware