From 5b5e03755014cc7b45160130413e680cbf8303c4 Mon Sep 17 00:00:00 2001 From: bclothier Date: Fri, 20 Oct 2023 11:46:05 -0500 Subject: [PATCH] Add more types of queries that should not be formatted by SQL formatter because they are a variant of pass-through queries. --- .../modules/clsDbQuery.cls | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Version Control.accda.src/modules/clsDbQuery.cls b/Version Control.accda.src/modules/clsDbQuery.cls index c09e1aa4..cd7d08df 100644 --- a/Version Control.accda.src/modules/clsDbQuery.cls +++ b/Version Control.accda.src/modules/clsDbQuery.cls @@ -62,12 +62,17 @@ Private Sub IDbComponent_Export(Optional strAlternatePath As String) On Error GoTo 0 If strSql <> vbNullString Then ' Pass-through queries should not be formatted, since they support formatting and comments. - If Options.SaveQuerySQL And dbs.QueryDefs(m_Query.Name).Type <> dbQSQLPassThrough Then - With New clsSqlFormatter - Perf.OperationStart "Format SQL" - WriteFile .FormatSQL(strSql), strFile - Perf.OperationEnd - End With + If Options.SaveQuerySQL Then + Select Case dbs.QueryDefs(m_Query.Name).Type + Case dbQSQLPassThrough, dbQSPTBulk, dbQSetOperation + 'Do not format + Case Else + With New clsSqlFormatter + Perf.OperationStart "Format SQL" + WriteFile .FormatSQL(strSql), strFile + Perf.OperationEnd + End With + End Select Else WriteFile strSql, strFile End If