change src folder and data argument

This commit is contained in:
Lukas Ziegler 2021-03-08 13:06:04 +01:00
parent 1d866f82df
commit fef001266a
2 changed files with 16 additions and 5 deletions

View File

@ -50,7 +50,9 @@ Function importModulesTxt(ACCDBFilename, sImportpath)
' if no path was given as argument, use a relative directory
If (sImportpath = "") Then
sImportpath = myPath & "\Source\"
sImportpath = myPath & "\src\"
else
sImportpath = myPath & sImportpath
End If
' check for existing file and ask to overwrite with the stub

View File

@ -13,7 +13,7 @@ Const acQuery = 1
Const acExportTable = 0
' BEGIN CODE
Dim fso, relDoc, ACCDBFilename, sExportpath
Dim fso, relDoc, ACCDBFilename, sExportpath, sData
Set fso = CreateObject("Scripting.FileSystemObject")
Set relDoc = CreateObject("Microsoft.XMLDOM")
@ -29,6 +29,9 @@ Else
sExportpath = Wscript.Arguments(1)
End If
sData = Wscript.Arguments(2)
Wscript.Echo "Export Data " & sData
exportModulesTxt ACCDBFilename, sExportpath
@ -46,7 +49,9 @@ Function exportModulesTxt(ACCDBFilename, sExportpath)
'if no path was given as argument, use a relative directory
If (sExportpath = "") Then
sExportpath = myPath & "\Source"
sExportpath = myPath & "\src"
Else
sExportpath = myPath & sExportpath
End If
On Error Resume Next
fso.DeleteFolder (sExportpath)
@ -62,7 +67,7 @@ Function exportModulesTxt(ACCDBFilename, sExportpath)
Else
oApplication.OpenCurrentDatabase ACCDBFilename
End If
oApplication.Visible = False
oApplication.Visible = True
' Wscript.Echo "exporting..."
Dim myObj
@ -90,7 +95,11 @@ Function exportModulesTxt(ACCDBFilename, sExportpath)
For Each myObj In oApplication.CurrentDb.TableDefs
If Not Left(myObj.Name, 4) = "MSys" Then
'Wscript.Echo "Exporting TABLE " & myObj.Name
oApplication.ExportXml acExportTable, myObj.Name, sExportpath & "\" & myObj.Name & ".table.txt"
if sData = 1 then
oApplication.ExportXml acExportTable, myObj.Name, sExportpath & "\" & myObj.Name & ".table.txt"
else
oApplication.ExportXml acExportTable, myObj.Name, ,sExportpath & "\" & myObj.Name & ".table.txt"
end if
'put the file path as a second parameter if you want to export the table data as well, instead of ommiting it and passing it into a third parameter for structure only
End If
Next