Exporting Acess 97 objects to XML

J

John Conklin

Is it possible to export Access 97 tables, queries,
reports and forms to XML?

I found how to do it using an Access 2002 database, but
can't find anything on Access 97.

Any help would be greatly appreciated.

Thanks,
John Conklin
 
C

chas

Hi John,

afaik XML support was added to Access in version 2000 and
is not available to previous versions. It may be possible
to create a VBA procedure to generate the XML file
directly,

Anyone got any examples/links?

hth

chas
 
D

Douglas J. Steele

Rick Brandt posted the following the other day:

Here's a rude and crude DAO routine. Appropriate object
closing and error handling should be added, but it gives you
an idea.

Sub TableToXML()

Dim MyDB As Database
Dim MyRS As Recordset
Dim fld As Field
Dim RowTxt As String

Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset("SELECT * FROM Table1")

Open "C:\Test.xml" For Output As #1

Print #1, "<?xml version=" & Chr(34) & "1.0" & Chr(34) &
"?>"
Print #1, " <Table1>"
Do Until MyRS.EOF = True
RowTxt = " <Row"
For Each fld In MyRS.Fields
RowTxt = RowTxt & " " & fld.Name & "=" & Chr(34) &
fld & Chr(34)
Next fld
Print #1, RowTxt & "></Row>"
MyRS.MoveNext
Loop

Print #1, " </Table1>"
Close #1

End Sub

Note that it has problems if the data contains special characters (accented
letters, etc.): a solution to that is to write a translator function that,
for example, converts é to &eacute;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top