Why are MDB files being modified when I'm just comparing/looking at them?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rprastein
    Enthusiast
    • Oct 2010
    • 25

    Why are MDB files being modified when I'm just comparing/looking at them?

    I'm comparing two MS Access .mdb files. One of them has some kind of issue, and can't be "converted". So I try comparing them as hex instead. Now, when I close that comparison tab, I get a notice that the file on the left (the one that didn't have a conversion error) has changed on disk, do I want to reload?

    It appears, based on the new comparison, that what was written in between was
    "TABLE Conversion Errorsn" [n increments each time I do this]
    "Database",,"Missing or broken VBE reference to file 'utility.mds'."

    What is going on?

    In fact, it seems to be doing this also when I just look through the menu options to find the option that will let me see what format or plug-in or conversion is being used to do this comparison.

    Addendum: Even when all I do is change focus away from Beyond Compare!

    I have BC version 3.3.10, Standard Edition for Windows.
    It I click Tools|File Formats, I see MS Access Databases *.accdb;*.mdb highlighted, no big surprise.
    Description:
    - Compares the text contents of Microsoft Access databases.
    - Requires:
    Microsoft Access 97 or newer (2007 for ACCDB)
    Windows Scripting Host
    Conversion:
    wscript Helpers\MDB_to_CSV.vbs %s %t

    "Disable editing" is checked.
    "Trim trailing whitespace" and "Convert leading spaces to tabs" under "When saving" are unchecked.
    Encoding is "Detect".
    4096 characters per line limit.
    "Ctrl+Z indicates end of file" is unchecked.

    Grammar tab is empty.
    Misc tab show Tab stop: 8 and everything elseis blank.

    So why are my files being modified when "Disable editing" is checked?

    My OS is Windows 7 (32-bit), and I have Office 2010 installed, if that makes any difference.

    Thanks,

    Rebeccah
    Last edited by rprastein; 23-Oct-2015, 12:01 AM.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16026

    #2
    Hello,

    Office files sometimes modify and save themselves when they are viewed. The conversion Beyond Compare uses calls out to Access to open and 'save as text' in the background. The file you are viewing in Beyond Compare is actually a copied, temp text file. However, the act of calling to Access can sometimes trigger Access to update an internal timestamp within the original .mdb file. This is actually why we have Editing Disabled: there is no Access script method to save back in the original format, and we don't want to overwrite the original .mdb file with out text data, so we Disable Editing.

    If look at two copies of the same test file in two test folders (TestA\file.mdb and TestB\file.mdb) then open one of them in Windows Explorer and double click to open in Access then close Access. Then launch BC3 and load a Folder Compare session and perform a Binary content scan, do the files then show as different?

    You can see similar behavior usually opening Excel files, especially if you perform any actions such as switching the Sheet tab (but not issuing a Save, it stills saves the switch).
    Aaron P Scooter Software

    Comment

    • Aaron
      Team Scooter
      • Oct 2007
      • 16026

      #3
      Due to how BC3 calls to Access to convert the files, the version of Office does likely make a difference in how the script is calling and opening your files. Let me see if I can find a test machine in office that has the same version. Would you be able to email us at [email protected] with your BCSupport.zip (Help menu -> Support; Export) and a pair of sample mdb files that you see the increment error with?
      Aaron P Scooter Software

      Comment

      • rprastein
        Enthusiast
        • Oct 2010
        • 25

        #4
        Originally posted by Aaron
        If look at two copies of the same test file in two test folders (TestA\file.mdb and TestB\file.mdb) then open one of them in Windows Explorer and double click to open in Access then close Access. Then launch BC3 and load a Folder Compare session and perform a Binary content scan, do the files then show as different?
        If I copy the same file to two folders and compare in BC using hex compare (I disabled the .mdb file format), there are no differences.
        If I then compare as text, still no differences.
        If I enable the .mdb file format and compare as text, both sides reload. They both have the same error message added.
        If I then compare as hex, they are different.

        Comment

        • rprastein
          Enthusiast
          • Oct 2010
          • 25

          #5
          Yes, it is the Office version difference that is causing the problem. After fooling around with BC last night I tried opening the file in Access and MS offered to upgrade the database to be compatible with Office 10, but that wasn't successful (it tried to create a .accdb file, but apparently the permissions table was messed up). After doing that, or maybe before just from doing the comparing, the original .mdb file was corrupted and didn't work right in the VB application that uses it (a VB 6 application; I should have just left it alone). In any event, I then noticed an open window, and it was the .mdb file. I could see there were a dozen or so error tables, each with one row mentioning the permissions table problem (MSysObjectsAccess or something like that).

          If simply opening an Access file (or Excel file) can trigger a write to that file, then perhaps it would be safer if the helpers would copy the file to a temp file first, and then open the temp file to convert - at least if editing is disabled (as it should be, and is, by default).

          I'll send you the BCSupport.zip file.

          Rebeccah

          Comment

          • rprastein
            Enthusiast
            • Oct 2010
            • 25

            #6
            Have you received the BCSupport.zip file? I haven't heard anything back.


            Thanks,

            Rebeccah

            Comment

            • Aaron
              Team Scooter
              • Oct 2007
              • 16026

              #7
              Hello,

              Sorry for the delay. We had a bit of a support backlog and I didn't see it come in the inbox. I was able to setup your test environment with a trial of Access (XP).

              With your set of 3 files, I only saw one of them throw the error, however this error did not cause the file to update. This might be due to Access XP is unable to edit the files unless they are converted to 2002/XP compatible. I Converted the file using the Access Tools menu, but then all of the errors went away and all the files opened as expected.

              Opening any of the XPconverted.mdb files and viewing a Table using Access or BC3 'views' it, which Access then updates the Last Modified timestamp and an internal metadata that makes the files binary different. I saw this behavior using either Access itself, or BC3 (which uses Access to perform the conversion). This type of edit is problematic for detecting if a file has been edited or merely viewed recently, but we haven't heard of any other cases where this Access update resulted in corrupt files. The visible content should remain equal and only the timestamp and non-visible header are updated by Access.

              Do you find that your version of Access adds extra text for any mdb you are opening? Any mdb created with a certain version of Access? Or specific mdbs? Any text or corruption is being added by Access and then saved, and seems like a bug with your specific version of Office.

              Our conversion process can be run in mass using a Rules-based scan on a Folder Compare. Copying every file that runs a conversion would have a significant impact on performance, and is at best a workaround for a buggy conversion program that shouldn't be editing the file in the first place.

              Would it be possible to update Access to a newer version which doesn't cause this corruption when viewing the files? Or determine and alter the process used to generate the problem .mdb files that your version of Access cannot handle?
              Aaron P Scooter Software

              Comment

              Working...