这是脚本:
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
我收到以下错误:
script: forltuptontest.vbs line: 6 Char: 14 Error: expected end of statement Code: 800A0401 Source: Microsoft VBScript compilation error
不确定第6行字符14出了什么问题
经过答案的出色帮助后:HansUp
这是我真正需要的脚本的工作版本。
更新后的代码如下所示:
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
HansUp的有效解决方案是:
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`
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句