|
@@ -63,21 +63,32 @@ Public Sub ExportAllSource()
|
|
|
Dim ucs2 As Boolean
|
|
Dim ucs2 As Boolean
|
|
|
Dim full_path As String
|
|
Dim full_path As String
|
|
|
|
|
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "Begin 'Export all sources'"
|
|
|
|
|
+
|
|
|
include_tables = get_include_tables()
|
|
include_tables = get_include_tables()
|
|
|
|
|
|
|
|
|
|
+ logger "ExportAllSource", "DEBUG", "Include_tables: " & include_tables
|
|
|
|
|
+ logger "ExportAllSource", "DEBUG", "Optimizer on: " & optimizer_activated()
|
|
|
|
|
+
|
|
|
|
|
+ logger "ExportAllSource", "DEBUG", "Save project"
|
|
|
|
|
+ CurrentProject.Application.RunCommand acCmdSave
|
|
|
|
|
+
|
|
|
Set Db = CurrentDb
|
|
Set Db = CurrentDb
|
|
|
|
|
|
|
|
CloseFormsReports
|
|
CloseFormsReports
|
|
|
'InitUsingUcs2
|
|
'InitUsingUcs2
|
|
|
|
|
|
|
|
source_path = VCS_Dir.ProjectPath() & "source\"
|
|
source_path = VCS_Dir.ProjectPath() & "source\"
|
|
|
|
|
+ logger "ExportAllSource", "DEBUG", "source_path: " & source_path
|
|
|
|
|
+
|
|
|
VCS_Dir.MkDirIfNotExist source_path
|
|
VCS_Dir.MkDirIfNotExist source_path
|
|
|
|
|
|
|
|
|
|
+ Call ExportProperties(CurrentDb, source_path & "database.properties")
|
|
|
|
|
+
|
|
|
obj_path = source_path & "queries\"
|
|
obj_path = source_path & "queries\"
|
|
|
VCS_Dir.ClearTextFilesFromDir obj_path, "bas"
|
|
VCS_Dir.ClearTextFilesFromDir obj_path, "bas"
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- Debug.Print VCS_String.PadRight("Exporting queries...", 24);
|
|
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "Exporting queries..."
|
|
|
|
|
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
For Each qry In Db.QueryDefs
|
|
For Each qry In Db.QueryDefs
|
|
@@ -85,6 +96,7 @@ Public Sub ExportAllSource()
|
|
|
'### 11/10/2016: add optimizer
|
|
'### 11/10/2016: add optimizer
|
|
|
If optimizer_activated() Then
|
|
If optimizer_activated() Then
|
|
|
If Not needs_export(acQuery, qry.name) > 0 Then
|
|
If Not needs_export(acQuery, qry.name) > 0 Then
|
|
|
|
|
+ logger "ExportProperties", "DEBUG", "Query " & qry.name & " skipped"
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
GoTo next_qry
|
|
GoTo next_qry
|
|
|
End If
|
|
End If
|
|
@@ -99,14 +111,12 @@ Public Sub ExportAllSource()
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
next_qry:
|
|
next_qry:
|
|
|
-
|
|
|
|
|
Call SysCmd(4, "Export query: " & obj_count & " on " & Db.QueryDefs.count)
|
|
Call SysCmd(4, "Export query: " & obj_count & " on " & Db.QueryDefs.count)
|
|
|
Next
|
|
Next
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "> " & obj_count & " queries exported"
|
|
|
|
|
|
|
|
- Call SysCmd(4, "Sanitize queries")
|
|
|
|
|
- Debug.Print VCS_String.PadRight("Sanitizing...", 15);
|
|
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "Sanitize queries..."
|
|
|
VCS_IE_Functions.SanitizeTextFiles obj_path, "bas"
|
|
VCS_IE_Functions.SanitizeTextFiles obj_path, "bas"
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
|
|
|
For Each obj_type In Split( _
|
|
For Each obj_type In Split( _
|
|
|
"forms|Forms|" & acForm & "," & _
|
|
"forms|Forms|" & acForm & "," & _
|
|
@@ -125,7 +135,7 @@ next_qry:
|
|
|
'a retirer
|
|
'a retirer
|
|
|
VCS_Dir.ClearTextFilesFromDir obj_path, "bas"
|
|
VCS_Dir.ClearTextFilesFromDir obj_path, "bas"
|
|
|
|
|
|
|
|
- Debug.Print VCS_String.PadRight("Exporting " & obj_type_label & "...", 24);
|
|
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "Exporting " & obj_type_label & "..."
|
|
|
|
|
|
|
|
For Each doc In Db.Containers(obj_type_name).Documents
|
|
For Each doc In Db.Containers(obj_type_name).Documents
|
|
|
|
|
|
|
@@ -133,6 +143,7 @@ next_qry:
|
|
|
If optimizer_activated() Then
|
|
If optimizer_activated() Then
|
|
|
If Not needs_export(obj_type_num, doc.name) > 0 Then
|
|
If Not needs_export(obj_type_num, doc.name) > 0 Then
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
|
|
+ logger "ExportAllSource", "DEBUG", obj_type_label & " '" & doc.name & " skipped"
|
|
|
GoTo next_doc
|
|
GoTo next_doc
|
|
|
End If
|
|
End If
|
|
|
End If
|
|
End If
|
|
@@ -142,6 +153,7 @@ next_qry:
|
|
|
|
|
|
|
|
If (Left$(doc.name, 1) <> "~") And _
|
|
If (Left$(doc.name, 1) <> "~") And _
|
|
|
(IsNotVCS(doc.name) Or ArchiveMyself) Then
|
|
(IsNotVCS(doc.name) Or ArchiveMyself) Then
|
|
|
|
|
+
|
|
|
If obj_type_label = "modules" Then
|
|
If obj_type_label = "modules" Then
|
|
|
ucs2 = False
|
|
ucs2 = False
|
|
|
Else
|
|
Else
|
|
@@ -163,24 +175,21 @@ next_qry:
|
|
|
|
|
|
|
|
next_doc:
|
|
next_doc:
|
|
|
Next
|
|
Next
|
|
|
-
|
|
|
|
|
- Call SysCmd(4, "Sanitizing")
|
|
|
|
|
- Debug.Print VCS_String.PadRight("Sanitizing...", 15);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "> " & obj_count & " " & obj_type_label & " exported"
|
|
|
|
|
|
|
|
If obj_type_label <> "modules" Then
|
|
If obj_type_label <> "modules" Then
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "Sanitizing " & obj_type_label
|
|
|
VCS_IE_Functions.SanitizeTextFiles obj_path, "bas"
|
|
VCS_IE_Functions.SanitizeTextFiles obj_path, "bas"
|
|
|
End If
|
|
End If
|
|
|
-
|
|
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
|
|
|
Next
|
|
Next
|
|
|
|
|
|
|
|
- Call SysCmd(4, "Export references")
|
|
|
|
|
VCS_Reference.ExportReferences source_path
|
|
VCS_Reference.ExportReferences source_path
|
|
|
|
|
|
|
|
'-------------------------table export------------------------
|
|
'-------------------------table export------------------------
|
|
|
|
|
|
|
|
- Call SysCmd(4, "Export tables")
|
|
|
|
|
|
|
+
|
|
|
obj_path = source_path & "tables\"
|
|
obj_path = source_path & "tables\"
|
|
|
VCS_Dir.MkDirIfNotExist Left$(obj_path, InStrRev(obj_path, "\"))
|
|
VCS_Dir.MkDirIfNotExist Left$(obj_path, InStrRev(obj_path, "\"))
|
|
|
VCS_Dir.ClearTextFilesFromDir obj_path, "txt", True
|
|
VCS_Dir.ClearTextFilesFromDir obj_path, "txt", True
|
|
@@ -206,7 +215,7 @@ next_doc:
|
|
|
Dim IncludeTablesCol As Collection
|
|
Dim IncludeTablesCol As Collection
|
|
|
Set IncludeTablesCol = StrSetToCol(include_tables, ",")
|
|
Set IncludeTablesCol = StrSetToCol(include_tables, ",")
|
|
|
|
|
|
|
|
- Debug.Print VCS_String.PadRight("Exporting " & obj_type_label & "...", 24);
|
|
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "Exporting " & obj_type_label & "..."
|
|
|
|
|
|
|
|
Dim update_this_tabledef As Boolean
|
|
Dim update_this_tabledef As Boolean
|
|
|
|
|
|
|
@@ -217,14 +226,7 @@ next_doc:
|
|
|
'or if the table definition has been modified since last export
|
|
'or if the table definition has been modified since last export
|
|
|
update_this_tabledef = (Not optimizer_activated() Or needs_export(acTable, td.name) > 0)
|
|
update_this_tabledef = (Not optimizer_activated() Or needs_export(acTable, td.name) > 0)
|
|
|
'###
|
|
'###
|
|
|
-
|
|
|
|
|
- If Not IsValidFileName(td.name) Then
|
|
|
|
|
- Debug.Print "ERROR:" & td.name & " is not a valid file name, table_def has been ignored"
|
|
|
|
|
- obj_count = obj_count + 1
|
|
|
|
|
- GoTo next_td
|
|
|
|
|
- End If
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
' This is not a system table
|
|
' This is not a system table
|
|
|
' this is not a temporary table
|
|
' this is not a temporary table
|
|
|
If Left$(td.name, 4) <> "MSys" And _
|
|
If Left$(td.name, 4) <> "MSys" And _
|
|
@@ -234,6 +236,8 @@ next_doc:
|
|
|
|
|
|
|
|
If update_this_tabledef Then
|
|
If update_this_tabledef Then
|
|
|
VCS_Table.ExportTableDef Db, td, VCS_IE_Functions.to_filename(td.name), obj_path
|
|
VCS_Table.ExportTableDef Db, td, VCS_IE_Functions.to_filename(td.name), obj_path
|
|
|
|
|
+ Else
|
|
|
|
|
+ logger "ExportAllSource", "DEBUG", "TableDef " & td.name & " skipped"
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
If include_tables = "*" Then
|
|
If include_tables = "*" Then
|
|
@@ -256,6 +260,8 @@ Err_TableNotFound:
|
|
|
Else
|
|
Else
|
|
|
If update_this_tabledef Then
|
|
If update_this_tabledef Then
|
|
|
VCS_Table.ExportLinkedTable td.name, obj_path
|
|
VCS_Table.ExportLinkedTable td.name, obj_path
|
|
|
|
|
+ Else
|
|
|
|
|
+ logger "ExportAllSource", "DEBUG", "TableDef " & td.name & " skipped"
|
|
|
End If
|
|
End If
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
@@ -264,17 +270,13 @@ Err_TableNotFound:
|
|
|
Call SysCmd(4, "Export table definition: " & obj_count & " on " & tds.count)
|
|
Call SysCmd(4, "Export table definition: " & obj_count & " on " & tds.count)
|
|
|
|
|
|
|
|
End If
|
|
End If
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
next_td:
|
|
next_td:
|
|
|
Next
|
|
Next
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "> " & obj_count & " tbldef exported"
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "> " & obj_data_count & " table's datas exported"
|
|
|
|
|
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
- If obj_data_count > 0 Then
|
|
|
|
|
- Debug.Print VCS_String.PadRight("Exported data...", 24) & "[" & obj_data_count & "]"
|
|
|
|
|
- End If
|
|
|
|
|
-
|
|
|
|
|
- Call SysCmd(4, "Export relations")
|
|
|
|
|
- Debug.Print VCS_String.PadRight("Exporting Relations...", 24);
|
|
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "Export relations"
|
|
|
|
|
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
obj_path = source_path & "relations\"
|
|
obj_path = source_path & "relations\"
|
|
@@ -294,21 +296,17 @@ next_td:
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
End If
|
|
End If
|
|
|
Next
|
|
Next
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "> " & obj_count & " relations exported"
|
|
|
|
|
|
|
|
'### 13/10/2016: add optimizer
|
|
'### 13/10/2016: add optimizer
|
|
|
' cleans the obsolete files (see CleanDirs in optimizer)
|
|
' cleans the obsolete files (see CleanDirs in optimizer)
|
|
|
If optimizer_activated() Then
|
|
If optimizer_activated() Then
|
|
|
- Call SysCmd(4, "Cleans the directories")
|
|
|
|
|
- Debug.Print VCS_String.PadRight("Cleans the directories", 24);
|
|
|
|
|
-
|
|
|
|
|
Call CleanDirs
|
|
Call CleanDirs
|
|
|
-
|
|
|
|
|
End If
|
|
End If
|
|
|
'###
|
|
'###
|
|
|
|
|
|
|
|
- Call SysCmd(4, "Export done")
|
|
|
|
|
- Debug.Print "Done."
|
|
|
|
|
|
|
+ logger "ExportAllSource", "INFO", "Export done"
|
|
|
End Sub
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
@@ -328,27 +326,23 @@ Public Sub ImportAllSource()
|
|
|
Dim obj_name As String
|
|
Dim obj_name As String
|
|
|
Dim ucs2 As Boolean
|
|
Dim ucs2 As Boolean
|
|
|
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Begin 'Import all sources'"
|
|
|
|
|
+ logger "ImportAllSource", "DEBUG", "Optimizer on: " & optimizer_activated()
|
|
|
|
|
+
|
|
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
|
|
|
|
|
|
|
- SysCmd acSysCmdInitMeter, "Importing: ", 11
|
|
|
|
|
- Dim counter As Integer
|
|
|
|
|
- counter = 0
|
|
|
|
|
- SysCmd acSysCmdUpdateMeter, counter
|
|
|
|
|
-
|
|
|
|
|
CloseFormsReports
|
|
CloseFormsReports
|
|
|
'InitUsingUcs2
|
|
'InitUsingUcs2
|
|
|
|
|
|
|
|
source_path = VCS_Dir.ProjectPath() & "source\"
|
|
source_path = VCS_Dir.ProjectPath() & "source\"
|
|
|
If Not fso.FolderExists(source_path) Then
|
|
If Not fso.FolderExists(source_path) Then
|
|
|
logger "ImportAllSource", "CRITICAL", "No source found at:" & source_path
|
|
logger "ImportAllSource", "CRITICAL", "No source found at:" & source_path
|
|
|
- Call err.Raise(60000, "Critical error", "Critical error occured, see the log file for more informations")
|
|
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
- Debug.Print
|
|
|
|
|
|
|
+ Call ImportProperties(CurrentDb, source_path & "database.properties")
|
|
|
|
|
|
|
|
If Not VCS_Reference.ImportReferences(source_path) Then
|
|
If Not VCS_Reference.ImportReferences(source_path) Then
|
|
|
- Debug.Print "Info: no references file in " & source_path
|
|
|
|
|
- Debug.Print
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Info: no references file in " & source_path
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
obj_path = source_path & "queries\"
|
|
obj_path = source_path & "queries\"
|
|
@@ -358,7 +352,7 @@ Public Sub ImportAllSource()
|
|
|
tempFilePath = VCS_File.TempFile()
|
|
tempFilePath = VCS_File.TempFile()
|
|
|
|
|
|
|
|
If Len(filename) > 0 Then
|
|
If Len(filename) > 0 Then
|
|
|
- Debug.Print VCS_String.PadRight("Importing queries...", 24);
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Importing queries..."
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
Do Until Len(filename) = 0
|
|
Do Until Len(filename) = 0
|
|
|
DoEvents
|
|
DoEvents
|
|
@@ -370,11 +364,8 @@ Public Sub ImportAllSource()
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|
|
filename = dir$()
|
|
|
Loop
|
|
Loop
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "> " & obj_count & " queries imported"
|
|
|
End If
|
|
End If
|
|
|
-
|
|
|
|
|
- counter = counter + 1
|
|
|
|
|
- SysCmd acSysCmdUpdateMeter, counter
|
|
|
|
|
|
|
|
|
|
VCS_Dir.DelIfExist tempFilePath
|
|
VCS_Dir.DelIfExist tempFilePath
|
|
|
|
|
|
|
@@ -382,58 +373,38 @@ Public Sub ImportAllSource()
|
|
|
obj_path = source_path & "tbldef\"
|
|
obj_path = source_path & "tbldef\"
|
|
|
filename = dir$(obj_path & "*.sql")
|
|
filename = dir$(obj_path & "*.sql")
|
|
|
If Len(filename) > 0 Then
|
|
If Len(filename) > 0 Then
|
|
|
- Debug.Print VCS_String.PadRight("Importing tabledefs...", 24);
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Importing TblDefs..."
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
Do Until Len(filename) = 0
|
|
Do Until Len(filename) = 0
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
- If DebugOutput Then
|
|
|
|
|
- If obj_count = 0 Then
|
|
|
|
|
- Debug.Print
|
|
|
|
|
- End If
|
|
|
|
|
- Debug.Print " [debug] table " & obj_name;
|
|
|
|
|
- Debug.Print
|
|
|
|
|
- End If
|
|
|
|
|
VCS_Table.ImportTableDef CStr(obj_name), obj_path
|
|
VCS_Table.ImportTableDef CStr(obj_name), obj_path
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|
|
filename = dir$()
|
|
|
Loop
|
|
Loop
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "> " & obj_count & " TblDefs imported"
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
- counter = counter + 1
|
|
|
|
|
- SysCmd acSysCmdUpdateMeter, counter
|
|
|
|
|
-
|
|
|
|
|
' restore linked tables - we must have access to the remote store to import these!
|
|
' restore linked tables - we must have access to the remote store to import these!
|
|
|
filename = dir$(obj_path & "*.LNKD")
|
|
filename = dir$(obj_path & "*.LNKD")
|
|
|
If Len(filename) > 0 Then
|
|
If Len(filename) > 0 Then
|
|
|
- Debug.Print VCS_String.PadRight("Importing Linked tabledefs...", 24);
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Importing Linked TblDefs..."
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
Do Until Len(filename) = 0
|
|
Do Until Len(filename) = 0
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
- If DebugOutput Then
|
|
|
|
|
- If obj_count = 0 Then
|
|
|
|
|
- Debug.Print
|
|
|
|
|
- End If
|
|
|
|
|
- Debug.Print " [debug] table " & obj_name;
|
|
|
|
|
- Debug.Print
|
|
|
|
|
- End If
|
|
|
|
|
VCS_Table.ImportLinkedTable CStr(obj_name), obj_path
|
|
VCS_Table.ImportLinkedTable CStr(obj_name), obj_path
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|
|
filename = dir$()
|
|
|
Loop
|
|
Loop
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "> " & obj_count & " Linked TblDefs imported"
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
- counter = counter + 1
|
|
|
|
|
- SysCmd acSysCmdUpdateMeter, counter
|
|
|
|
|
-
|
|
|
|
|
' NOW we may load data
|
|
' NOW we may load data
|
|
|
obj_path = source_path & "tables\"
|
|
obj_path = source_path & "tables\"
|
|
|
filename = dir$(obj_path & "*.txt")
|
|
filename = dir$(obj_path & "*.txt")
|
|
|
If Len(filename) > 0 Then
|
|
If Len(filename) > 0 Then
|
|
|
- Debug.Print VCS_String.PadRight("Importing tables...", 24);
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Importing table's data..."
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
Do Until Len(filename) = 0
|
|
Do Until Len(filename) = 0
|
|
|
DoEvents
|
|
DoEvents
|
|
@@ -443,17 +414,14 @@ Public Sub ImportAllSource()
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|
|
filename = dir$()
|
|
|
Loop
|
|
Loop
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "> " & obj_count & " table's data imported"
|
|
|
End If
|
|
End If
|
|
|
-
|
|
|
|
|
- counter = counter + 1
|
|
|
|
|
- SysCmd acSysCmdUpdateMeter, counter
|
|
|
|
|
|
|
|
|
|
'load Data Macros - not DRY!
|
|
'load Data Macros - not DRY!
|
|
|
obj_path = source_path & "tbldef\"
|
|
obj_path = source_path & "tbldef\"
|
|
|
filename = dir$(obj_path & "*.xml")
|
|
filename = dir$(obj_path & "*.xml")
|
|
|
If Len(filename) > 0 Then
|
|
If Len(filename) > 0 Then
|
|
|
- Debug.Print VCS_String.PadRight("Importing Data Macros...", 24);
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Importing Data Macros..."
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
Do Until Len(filename) = 0
|
|
Do Until Len(filename) = 0
|
|
|
DoEvents
|
|
DoEvents
|
|
@@ -464,14 +432,8 @@ Public Sub ImportAllSource()
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|
|
filename = dir$()
|
|
|
Loop
|
|
Loop
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "> " & obj_count & " DataMacros imported"
|
|
|
End If
|
|
End If
|
|
|
-
|
|
|
|
|
- counter = counter + 1
|
|
|
|
|
- SysCmd acSysCmdUpdateMeter, counter
|
|
|
|
|
-
|
|
|
|
|
- 'import Data Macros
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
For Each obj_type In Split( _
|
|
For Each obj_type In Split( _
|
|
|
"forms|" & acForm & "," & _
|
|
"forms|" & acForm & "," & _
|
|
@@ -488,7 +450,7 @@ Public Sub ImportAllSource()
|
|
|
|
|
|
|
|
filename = dir$(obj_path & "*.bas")
|
|
filename = dir$(obj_path & "*.bas")
|
|
|
If Len(filename) > 0 Then
|
|
If Len(filename) > 0 Then
|
|
|
- Debug.Print VCS_String.PadRight("Importing " & obj_type_label & "...", 24);
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Importing " & obj_type_label & "..."
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
Do Until Len(filename) = 0
|
|
Do Until Len(filename) = 0
|
|
|
' DoEvents no good idea!
|
|
' DoEvents no good idea!
|
|
@@ -509,17 +471,14 @@ Public Sub ImportAllSource()
|
|
|
End If
|
|
End If
|
|
|
filename = dir$()
|
|
filename = dir$()
|
|
|
Loop
|
|
Loop
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "> " & obj_count & " " & obj_type_label & " imported"
|
|
|
|
|
|
|
|
End If
|
|
End If
|
|
|
-
|
|
|
|
|
- counter = counter + 1
|
|
|
|
|
- SysCmd acSysCmdUpdateMeter, counter
|
|
|
|
|
|
|
|
|
|
Next
|
|
Next
|
|
|
|
|
|
|
|
'import Print Variables
|
|
'import Print Variables
|
|
|
- Debug.Print VCS_String.PadRight("Importing Print Vars...", 24);
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Importing Print Vars..."
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
|
|
|
|
|
obj_path = source_path & "reports\"
|
|
obj_path = source_path & "reports\"
|
|
@@ -532,10 +491,10 @@ Public Sub ImportAllSource()
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|
|
filename = dir$()
|
|
|
Loop
|
|
Loop
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "> " & obj_count & " Print Vars imported"
|
|
|
|
|
|
|
|
'import relations
|
|
'import relations
|
|
|
- Debug.Print VCS_String.PadRight("Importing Relations...", 24);
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Importing Relations..."
|
|
|
obj_count = 0
|
|
obj_count = 0
|
|
|
obj_path = source_path & "relations\"
|
|
obj_path = source_path & "relations\"
|
|
|
filename = dir$(obj_path & "*.txt")
|
|
filename = dir$(obj_path & "*.txt")
|
|
@@ -545,12 +504,10 @@ Public Sub ImportAllSource()
|
|
|
obj_count = obj_count + 1
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|
|
filename = dir$()
|
|
|
Loop
|
|
Loop
|
|
|
- Debug.Print "[" & obj_count & "]"
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "> " & obj_count & " Relations imported"
|
|
|
DoEvents
|
|
DoEvents
|
|
|
|
|
|
|
|
- SysCmd acSysCmdRemoveMeter
|
|
|
|
|
-
|
|
|
|
|
- Debug.Print "Done."
|
|
|
|
|
|
|
+ logger "ImportAllSource", "INFO", "Import Done"
|
|
|
End Sub
|
|
End Sub
|
|
|
|
|
|
|
|
' Main entry point for ImportProject.
|
|
' Main entry point for ImportProject.
|
|
@@ -659,6 +616,8 @@ End Sub
|
|
|
' Close all open forms.
|
|
' Close all open forms.
|
|
|
Private Sub CloseFormsReports()
|
|
Private Sub CloseFormsReports()
|
|
|
On Error GoTo errorHandler
|
|
On Error GoTo errorHandler
|
|
|
|
|
+ logger "CloseFormsReports", "DEBUG", "Close any opened form or report"
|
|
|
|
|
+
|
|
|
Do While Forms.count > 0
|
|
Do While Forms.count > 0
|
|
|
DoCmd.Close acForm, Forms(0).name
|
|
DoCmd.Close acForm, Forms(0).name
|
|
|
DoEvents
|
|
DoEvents
|
|
@@ -670,8 +629,7 @@ Private Sub CloseFormsReports()
|
|
|
Exit Sub
|
|
Exit Sub
|
|
|
|
|
|
|
|
errorHandler:
|
|
errorHandler:
|
|
|
- Debug.Print "VCS_ImportExport.CloseFormsReports: Error #" & err.number & vbCrLf & _
|
|
|
|
|
- err.Description
|
|
|
|
|
|
|
+ logger "CloseFormsReports", "CRITICAL", "Error #" & err.number & err.Description
|
|
|
End Sub
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|