Skip to content

Commit

Permalink
Merge pull request joyfullservice#448 from bclothier/MiscBugFixes
Browse files Browse the repository at this point in the history
Misc bug fixes
  • Loading branch information
joyfullservice authored Oct 20, 2023
2 parents 8f2f325 + 490d82e commit 5362b37
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
8 changes: 7 additions & 1 deletion Version Control.accda.src/forms/frmVCSMain.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,13 @@ End Sub
'---------------------------------------------------------------------------------------
'
Public Sub AutoClose()
Me.TimerInterval = 2000
'The procedure may be called when the form has been closed.
'In this case, a VBA error may occur, so we check if the
'form is loaded before setting the property. We do not use
'the Me.Name because that would be also an error.
If IsLoaded(acForm, "frmVCSMain", False) Then
Me.TimerInterval = 2000
End If
End Sub


Expand Down
17 changes: 11 additions & 6 deletions Version Control.accda.src/modules/clsDbQuery.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion Version Control.accda.src/modules/clsSqlFormatter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Private m_varWordCache(1 To 2) As Variant


'---------------------------------------------------------------------------------------
' Procedure : Format
' Procedure : FormatSQL
' Author : Adam Waller
' Date : 4/1/2020
' Purpose : This is the main function used outside the class for SQL formatting.
Expand Down Expand Up @@ -1214,6 +1214,12 @@ End Function
'
Private Function GetNextTokenID(lngCurrentToken As Long, Optional intExceptType As eTokenTypes) As Long
Dim intToken As Integer

If lngCurrentToken + 1 > m_colTokens.Count Then
GetNextTokenID = lngCurrentToken + 1
Exit Function
End If

For intToken = lngCurrentToken + 1 To m_colTokens.Count
If m_colTokens(intToken)(0) <> intExceptType Then
GetNextTokenID = intToken
Expand Down

0 comments on commit 5362b37

Please sign in to comment.