joyfullservice / msaccess-vcs-addin

Synchronize your Access Forms, Macros, Modules, Queries, Reports, and more with a version control system.
Other
211 stars 41 forks source link

Question: Latest export shows many changes I didn't make... (local private repo, nobody else has access) #267

Closed jhgarrison closed 3 years ago

jhgarrison commented 3 years ago

I'm working on a legacy database that had a bunch of obsolete, broken table links. I deleted the table links and initialized the dependency tracker, and when I exported this updated version, git showed me 223 files changed. The changes don't look like anything I did, and range from stuff like this...

@@ -391,10 +391,16 @@ Begin Form
                             Action ="Close"
                             Argument ="-1"
                             Argument =""
                             Argument ="0"
                         End
+                        Begin
+                            Comment ="_AXL:<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\015\012<UserI"
+                                "nterfaceMacro For=\"cmdClose\" xmlns=\"http://schemas.microsoft.com/office/acces"
+                                "sservices/2009/11/application\"><Statements><Action Name=\"CloseWindow\"/></Stat"
+                                "ements></UserInterfaceMacro>"
+                        End
                     End

                     LayoutCachedLeft =8100
                     LayoutCachedTop =360
                     LayoutCachedWidth =8775

to changes in WebImagePadding values, to minor changes in other padding and positioning values.

QUESTION: Can I assume all of this was the result of the Object Dependency tracker being turned on? Did it force a recompile of code that hadn't been recompiled in forever, triggering an "upgrade" from some previous version of Access and VBA? Many of the changes look like they add new attributes to objects, for example this update to a query definition:

@@ -1,16 +1,21 @@
 Operation =1
 Option =0
-Where ="(((tblLIBCheckOut.chkCheckInDate) Is Null))"
+Where ="((([tblLIBCheckOut].[chkCheckInDate]) Is Null))"
 Begin InputTables
     Name ="tblLIBCheckOut"
 End
 Begin OutputColumns
+    Alias ="Expr1"
     Expression ="tblLIBCheckOut.chkLibraryBookID"
+    Alias ="Expr2"
     Expression ="tblLIBCheckOut.chkMemberID"
+    Alias ="Expr3"

I'm 99% certain my guess is correct, just wanted to run it by you in case msaccess-vcs-integration is involved.

joyfullservice commented 3 years ago

Yes, I think you are probably correct. We encountered this when working through the sanitizing of color values in #235 and #183.

What I like to do in cases like this is to separate these system-generated changes from my actual code/object changes using different commits in version control.

You may also notice a number of changed files the first time you export after building from source for the first time. (Building from source was a key milestone in this project, where the database can be constructed entirely from source files.) I like to get each project to the point where I can build a fully functioning version from source, then exclude the binary file (*.accdb) from version control, and just track everything at the source file level.

The query changes that you noticed are probably a different issue. It looks like perhaps it couldn't find the column names from the tables (perhaps these were from linked tables that were removed?) and just aliased the column names instead. Here again this add-in is a big help because it highlights these changes right away when you export source, instead of finding a broken query weeks or months later. 😄

Hope that helps!

jhgarrison commented 3 years ago

Thanks for the explanation. The changed queries all referred to the missing tables, so you are most likely correct. They'll get removed in a later commit. And yes, I separated all the "upgrade" changes into a separate commit.

Awesome tool, thanks for putting the work into this!