Search code examples
ms-accessms-access-2007

access 2003 adp opened & saved in 2007 now behaves odd in 2003


I inherited an access 2003 ADP file which uses sql 2000 as it's data source. This is my first access maintenance project and not thinking about the issues involved simply opened it in access 2007 on my dev machine. It of course worked and I proceeded to do the work requested.

I have completed the work and presented the file to the client, which he opens in access 2003 and proceeds to receive several errors, all related to variables not being declared. It is at this point I realize that none of the code files have Option Explicit set. I look at the project in access 2007 again - no errors. The behaviour is as if access 2007 is respecting the Lack of Option Explicit and working as expected, but access 2003 "thinks" Option Explicit is set, even though it never appears in any code files.

I realize I could just re-do the work using only access 2003, but that would be more time-consuming than I'd like.


Solution

  • Weird problem - I can't see how Access 2003 would check for explicit varible declarations without any Option Explicit. Something else must be going on.

    Can you reproduce the behaviour on your machine using Access 2003?

    How about you actually declare your variables? You should have Option Explicit set regardless.

    UPDATE:

    Since the goal is to try and get the Access 2003 mdb (saved from 2007) working. I would try one more thing.

    Using Access 2003 open the mdb with the /decompile switch

    • Make a backup of your mdb
    • Open your mdb (hold the SHIFT key down to stop any code from running) via a short cut: msaccess.exe database.mdb /decompile
    • Open a module and compile your app
    • Save and close Access
    • Open again (SHIFT again) without decompile
    • Compact and repair database
    • close Access