Skip to content

Commit

Permalink
Fix SQL export of non-formatted queries
Browse files Browse the repository at this point in the history
Pass-through queries are now exported as SQL again.
  • Loading branch information
joyfullservice committed Dec 1, 2023
1 parent abb2d24 commit e3333a4
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions Version Control.accda.src/modules/clsDbQuery.cls
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,18 @@ 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 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, esdAccess), strFile
Perf.OperationEnd
End With
End Select
Else
WriteFile strSql, strFile
End If
Select Case dbs.QueryDefs(m_Query.Name).Type
Case dbQSQLPassThrough, dbQSPTBulk, dbQSetOperation
'Do not format
Case Else
With New clsSqlFormatter
Perf.OperationStart "Format SQL"
strSql = .FormatSQL(strSql, esdAccess)
Perf.OperationEnd
End With
End Select
' Write SQL to file
WriteFile strSql, strFile
End If
Perf.OperationEnd
Log.Add " " & m_Query.Name & " (SQL)", Options.ShowDebug
Expand Down

0 comments on commit e3333a4

Please sign in to comment.