xml output from access 2000

java_ftp-er

New member
Local time
Today, 10:41
Joined
Aug 31, 2008
Messages
1
Xml output from access 2000
hi,

I need to output a table to an xml file. good old google has returned the following:-
Code:
Code:
Private Sub Form_Open(Cancel As Integer)


  Dim sXMLPath As String
  Const cOverWrite As Integer = 1
  sXMLPath = "c:\technologies.xml"
  
  ' ExportXML ObjectType, DataSource, DataTarget
  ExportXML acExportTable, "technologies", sXMLPath
  
End Sub

Howevever this falls over with Compile error: syntax error on the following line:-
ExportXML acExportTable , "technologies", sXMLPath


Any thoughts greatly appreciated.
 
I personally can't see anything wrong with the code you have shown and it should produce a XML file named technologies.xml within the Root directory (folder) of Hard Disk Drive C.

To me, it doesn't look like you need the Constant declaration (Const cOverWrite As Integer = 1).

Other than that the code should work and I see no reason for the Compile Error. What exactly is the error you are getting?
Does it just say Compile Error?

just for the fun of it...try:

Code:
Dim sXMLPath As String

sXMLPath = "c:\technologies.xml"
[B][COLOR="Blue"]Application.[/COLOR][/B]ExportXML acExportTable, "technologies", sXMLPath

.
 
offhand it might be

docmd.exportxml

-------
ignore this - i have since checked following later comments, and exportxml IS a native fuction/command in AXP, etc
 
Last edited:
Hello java_ftp-er!
On my Pc it works as it is in your code.
 
No the XML export (and import) methods didn't appear until Access 2002. (And then were enhanced in 2003).
If you want such export from 2000 you'll be doing it by hand. (Unless you have an intermediate application - such as Excel version with a functional XML export present).

All that said - in Access 2000 - it should surely present a different error message (Undefined function). Syntax error implies you've got the syntax of an existing method wrong.
You've not created your own so named function at all?

Examine the Application object (in intellisense - writing code).
Application.
ExportXML should not be an option.
(How sure are you you're using Access 2000 and not just a file in that format?)
 

Users who are viewing this thread

Back
Top Bottom