Exporting Acess 97 objects to XML

  • Thread starter Thread starter John Conklin
  • Start date Start date
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
 
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
 
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;
 
Back
Top