|
|
@@ -61,6 +61,7 @@ Public Sub ExportAllSource()
|
|
|
Dim obj_count As Integer
|
|
|
Dim obj_data_count As Integer
|
|
|
Dim ucs2 As Boolean
|
|
|
+ Dim full_path As String
|
|
|
|
|
|
include_tables = get_include_tables()
|
|
|
|
|
|
@@ -75,6 +76,7 @@ Public Sub ExportAllSource()
|
|
|
obj_path = source_path & "queries\"
|
|
|
VCS_Dir.ClearTextFilesFromDir obj_path, "bas"
|
|
|
|
|
|
+
|
|
|
Debug.Print VCS_String.PadRight("Exporting queries...", 24);
|
|
|
|
|
|
obj_count = 0
|
|
|
@@ -82,22 +84,17 @@ Public Sub ExportAllSource()
|
|
|
|
|
|
'### 11/10/2016: add optimizer
|
|
|
If optimizer_activated() Then
|
|
|
- If Not is_dirty(acQuery, qry.name) Then
|
|
|
+ If Not needs_export(acQuery, qry.name) > 0 Then
|
|
|
obj_count = obj_count + 1
|
|
|
GoTo next_qry
|
|
|
End If
|
|
|
End If
|
|
|
'###
|
|
|
-
|
|
|
- If Not IsValidFileName(qry.name) Then
|
|
|
- Debug.Print "ERROR:" & qry.name & " is not a valid file name, query has been ignored"
|
|
|
- obj_count = obj_count + 1
|
|
|
- GoTo next_qry
|
|
|
- End If
|
|
|
|
|
|
DoEvents
|
|
|
If Left$(qry.name, 1) <> "~" Then
|
|
|
- VCS_IE_Functions.ExportObject acQuery, qry.name, obj_path & qry.name & ".bas", VCS_File.UsingUcs2
|
|
|
+ full_path = obj_path & VCS_IE_Functions.to_filename(qry.name) & ".bas"
|
|
|
+ VCS_IE_Functions.ExportObject acQuery, qry.name, full_path, VCS_File.UsingUcs2
|
|
|
obj_count = obj_count + 1
|
|
|
End If
|
|
|
|
|
|
@@ -134,7 +131,7 @@ next_qry:
|
|
|
|
|
|
'### 11/10/2016: add optimizer
|
|
|
If optimizer_activated() Then
|
|
|
- If Not is_dirty(obj_type_num, doc.name) Then
|
|
|
+ If Not needs_export(obj_type_num, doc.name) > 0 Then
|
|
|
obj_count = obj_count + 1
|
|
|
GoTo next_doc
|
|
|
End If
|
|
|
@@ -143,12 +140,6 @@ next_qry:
|
|
|
|
|
|
DoEvents
|
|
|
|
|
|
- If Not IsValidFileName(doc.name) Then
|
|
|
- Debug.Print "ERROR:" & doc.name & " is not a valid file name, " & obj_type_name & " has been ignored"
|
|
|
- obj_count = obj_count + 1
|
|
|
- GoTo next_doc
|
|
|
- End If
|
|
|
-
|
|
|
If (Left$(doc.name, 1) <> "~") And _
|
|
|
(IsNotVCS(doc.name) Or ArchiveMyself) Then
|
|
|
If obj_type_label = "modules" Then
|
|
|
@@ -156,9 +147,12 @@ next_qry:
|
|
|
Else
|
|
|
ucs2 = VCS_File.UsingUcs2
|
|
|
End If
|
|
|
- VCS_IE_Functions.ExportObject obj_type_num, doc.name, obj_path & doc.name & ".bas", ucs2
|
|
|
+
|
|
|
+ full_path = obj_path & VCS_IE_Functions.to_filename(doc.name) & ".bas"
|
|
|
+ VCS_IE_Functions.ExportObject obj_type_num, doc.name, full_path, ucs2
|
|
|
|
|
|
If obj_type_label = "reports" Then
|
|
|
+ full_path = obj_path & VCS_IE_Functions.to_filename(doc.name) & ".pv"
|
|
|
VCS_Report.ExportPrintVars doc.name, obj_path & doc.name & ".pv"
|
|
|
End If
|
|
|
|
|
|
@@ -221,7 +215,7 @@ next_doc:
|
|
|
'### 11/10/2016: add optimizer
|
|
|
'only update the table definition if this is a complete export
|
|
|
'or if the table definition has been modified since last export
|
|
|
- update_this_tabledef = (Not optimizer_activated() Or is_dirty(acTable, td.name))
|
|
|
+ update_this_tabledef = (Not optimizer_activated() Or needs_export(acTable, td.name) > 0)
|
|
|
'###
|
|
|
|
|
|
If Not IsValidFileName(td.name) Then
|
|
|
@@ -239,7 +233,7 @@ next_doc:
|
|
|
If Len(td.connect) = 0 Then ' this is not an external table
|
|
|
|
|
|
If update_this_tabledef Then
|
|
|
- VCS_Table.ExportTableDef Db, td, td.name, obj_path
|
|
|
+ VCS_Table.ExportTableDef Db, td, VCS_IE_Functions.to_filename(td.name), obj_path
|
|
|
End If
|
|
|
|
|
|
If include_tables = "*" Then
|
|
|
@@ -346,8 +340,8 @@ Public Sub ImportAllSource()
|
|
|
|
|
|
source_path = VCS_Dir.ProjectPath() & "source\"
|
|
|
If Not fso.FolderExists(source_path) Then
|
|
|
- MsgBox "No source found at:" & vbCrLf & source_path, vbExclamation, "Import failed"
|
|
|
- Exit Sub
|
|
|
+ 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
|
|
|
|
|
|
Debug.Print
|
|
|
@@ -369,6 +363,7 @@ Public Sub ImportAllSource()
|
|
|
Do Until Len(filename) = 0
|
|
|
DoEvents
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
+ obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
VCS_IE_Functions.ImportObject acQuery, obj_name, obj_path & filename, VCS_File.UsingUcs2
|
|
|
VCS_IE_Functions.ExportObject acQuery, obj_name, tempFilePath, VCS_File.UsingUcs2
|
|
|
VCS_IE_Functions.ImportObject acQuery, obj_name, tempFilePath, VCS_File.UsingUcs2
|
|
|
@@ -391,6 +386,7 @@ Public Sub ImportAllSource()
|
|
|
obj_count = 0
|
|
|
Do Until Len(filename) = 0
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
+ obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
If DebugOutput Then
|
|
|
If obj_count = 0 Then
|
|
|
Debug.Print
|
|
|
@@ -415,6 +411,7 @@ Public Sub ImportAllSource()
|
|
|
obj_count = 0
|
|
|
Do Until Len(filename) = 0
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
+ obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
If DebugOutput Then
|
|
|
If obj_count = 0 Then
|
|
|
Debug.Print
|
|
|
@@ -441,6 +438,7 @@ Public Sub ImportAllSource()
|
|
|
Do Until Len(filename) = 0
|
|
|
DoEvents
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
+ obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
VCS_Table.ImportTableData CStr(obj_name), obj_path
|
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|
|
|
@@ -460,6 +458,7 @@ Public Sub ImportAllSource()
|
|
|
Do Until Len(filename) = 0
|
|
|
DoEvents
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
+ obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
'VCS_Table.ImportTableData CStr(obj_name), obj_path
|
|
|
VCS_DataMacro.ImportDataMacros obj_name, obj_path
|
|
|
obj_count = obj_count + 1
|
|
|
@@ -494,6 +493,7 @@ Public Sub ImportAllSource()
|
|
|
Do Until Len(filename) = 0
|
|
|
' DoEvents no good idea!
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
+ obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
If obj_type_label = "modules" Then
|
|
|
ucs2 = False
|
|
|
Else
|
|
|
@@ -504,7 +504,7 @@ Public Sub ImportAllSource()
|
|
|
obj_count = obj_count + 1
|
|
|
Else
|
|
|
If ArchiveMyself Then
|
|
|
- MsgBox "Module " & obj_name & " could not be updated while running. Ensure latest version is included!", vbExclamation, "Warning"
|
|
|
+ logger "ImportAllSource", "WARNING", "Module " & obj_name & " could not be updated while running. Ensure latest version is included!"
|
|
|
End If
|
|
|
End If
|
|
|
filename = dir$()
|
|
|
@@ -527,6 +527,7 @@ Public Sub ImportAllSource()
|
|
|
Do Until Len(filename) = 0
|
|
|
DoEvents
|
|
|
obj_name = Mid$(filename, 1, InStrRev(filename, ".") - 1)
|
|
|
+ obj_name = VCS_IE_Functions.to_accessname(obj_name)
|
|
|
VCS_Report.ImportPrintVars obj_name, obj_path & filename
|
|
|
obj_count = obj_count + 1
|
|
|
filename = dir$()
|