Skip to content

Commit

Permalink
Include class instancing in code module hash
Browse files Browse the repository at this point in the history
Class modules have an instancing property that needs to be checked for changes along with the VBA code to ensure that the database object matches the last export. A module will now be flagged as changed if the instancing property is changed.
  • Loading branch information
joyfullservice committed Dec 7, 2023
1 parent a47bf5e commit 65f3499
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Version Control.accda.src/modules/modHash.bas
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ Public Function GetCodeModuleHash(intType As eDatabaseComponentType, strName As
Dim strPrefix As String
Dim proj As VBProject
Dim blnNoCode As Boolean
Dim strInstancingFlag As String

Perf.OperationStart "Get VBA Hash"
Select Case intType
Expand Down Expand Up @@ -285,8 +286,14 @@ Public Function GetCodeModuleHash(intType As eDatabaseComponentType, strName As

' Output the hash
If Not cmpItem Is Nothing Then
With cmpItem.CodeModule
strHash = GetStringHash(.Lines(1, 999999))
With cmpItem
' Check for class module
If .Type = vbext_ct_ClassModule Then
' Save instancing property as a flag to include with hash
strInstancingFlag = CStr(.Properties("Instancing"))
End If
' Generate hash from code and instancing flag (if applicable)
strHash = GetStringHash(.CodeModule.Lines(1, 999999) & strInstancingFlag)
End With
End If

Expand Down

0 comments on commit 65f3499

Please sign in to comment.