This is the script:
Option Explicit
'Supported in Access 2003 and newer versions
'Add a reference to "Microsoft Access xx.0 Object Library"
'or change code to do Late Binding to support multiple Access versions
Private Sub Command1_Click()
Dim oApp As Access.Application
Set oApp = CreateObject("Access.Application")
oApp.OpenCurrentDatabase "C:\student_id_Ft Lupton.mdb", Exclusive:=False
oApp.ExportXML ObjectType:=acExportTable, _
DataSource:="Ft_lupton", _
DataTarget:="C:\fortlupton.xml"
oApp.CloseCurrentDatabase
oApp.Quit acQuitSaveNone
Set oApp = Nothing
End Sub
I get the following error:
script: forltuptontest.vbs
line: 6
Char: 14
Error: expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error
not sure what is wrong with line 6 character 14
after the wonderful help from the answer by:HansUp
here is a working version of the script which is exactly what I needed.
updated code looks like this:
Dim oApp
Set oApp = CreateObject("Access.Application")
Const acExportTable = 0
Const acQuitSaveNone = 2
oApp.OpenCurrentDatabase "C:\users\amoore19\desktop\Database\student_id_Ft Lupton.mdb", False
oApp.ExportXML 0, "Ft_lupton", "C:\users\amoore19\desktop\fortlupton.xml"
oApp.CloseCurrentDatabase
oApp.Quit 2
Set oApp = Nothing
oApp.ExportXML acExportTableif that seems clearer.