change src folder and data argument
This commit is contained in:
parent
1d866f82df
commit
fef001266a
@ -50,7 +50,9 @@ Function importModulesTxt(ACCDBFilename, sImportpath)
|
|||||||
|
|
||||||
' if no path was given as argument, use a relative directory
|
' if no path was given as argument, use a relative directory
|
||||||
If (sImportpath = "") Then
|
If (sImportpath = "") Then
|
||||||
sImportpath = myPath & "\Source\"
|
sImportpath = myPath & "\src\"
|
||||||
|
else
|
||||||
|
sImportpath = myPath & sImportpath
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' check for existing file and ask to overwrite with the stub
|
' check for existing file and ask to overwrite with the stub
|
||||||
|
@ -13,7 +13,7 @@ Const acQuery = 1
|
|||||||
Const acExportTable = 0
|
Const acExportTable = 0
|
||||||
|
|
||||||
' BEGIN CODE
|
' BEGIN CODE
|
||||||
Dim fso, relDoc, ACCDBFilename, sExportpath
|
Dim fso, relDoc, ACCDBFilename, sExportpath, sData
|
||||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||||
Set relDoc = CreateObject("Microsoft.XMLDOM")
|
Set relDoc = CreateObject("Microsoft.XMLDOM")
|
||||||
|
|
||||||
@ -29,6 +29,9 @@ Else
|
|||||||
sExportpath = Wscript.Arguments(1)
|
sExportpath = Wscript.Arguments(1)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
sData = Wscript.Arguments(2)
|
||||||
|
|
||||||
|
Wscript.Echo "Export Data " & sData
|
||||||
|
|
||||||
exportModulesTxt ACCDBFilename, sExportpath
|
exportModulesTxt ACCDBFilename, sExportpath
|
||||||
|
|
||||||
@ -46,7 +49,9 @@ Function exportModulesTxt(ACCDBFilename, sExportpath)
|
|||||||
|
|
||||||
'if no path was given as argument, use a relative directory
|
'if no path was given as argument, use a relative directory
|
||||||
If (sExportpath = "") Then
|
If (sExportpath = "") Then
|
||||||
sExportpath = myPath & "\Source"
|
sExportpath = myPath & "\src"
|
||||||
|
Else
|
||||||
|
sExportpath = myPath & sExportpath
|
||||||
End If
|
End If
|
||||||
On Error Resume Next
|
On Error Resume Next
|
||||||
fso.DeleteFolder (sExportpath)
|
fso.DeleteFolder (sExportpath)
|
||||||
@ -62,7 +67,7 @@ Function exportModulesTxt(ACCDBFilename, sExportpath)
|
|||||||
Else
|
Else
|
||||||
oApplication.OpenCurrentDatabase ACCDBFilename
|
oApplication.OpenCurrentDatabase ACCDBFilename
|
||||||
End If
|
End If
|
||||||
oApplication.Visible = False
|
oApplication.Visible = True
|
||||||
|
|
||||||
' Wscript.Echo "exporting..."
|
' Wscript.Echo "exporting..."
|
||||||
Dim myObj
|
Dim myObj
|
||||||
@ -90,7 +95,11 @@ Function exportModulesTxt(ACCDBFilename, sExportpath)
|
|||||||
For Each myObj In oApplication.CurrentDb.TableDefs
|
For Each myObj In oApplication.CurrentDb.TableDefs
|
||||||
If Not Left(myObj.Name, 4) = "MSys" Then
|
If Not Left(myObj.Name, 4) = "MSys" Then
|
||||||
'Wscript.Echo "Exporting TABLE " & myObj.Name
|
'Wscript.Echo "Exporting TABLE " & myObj.Name
|
||||||
|
if sData = 1 then
|
||||||
oApplication.ExportXml acExportTable, myObj.Name, sExportpath & "\" & myObj.Name & ".table.txt"
|
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
|
'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
|
End If
|
||||||
Next
|
Next
|
||||||
|
Loading…
Reference in New Issue
Block a user