Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009

    Unanswered: control opening of application by Access version...

    I'm sure this has been addressed before but couldn't find any references. I am trying to control whether a database is opened or not by checking the version of the application on users compute against the version the app was developed in. Specifically I am trying to stop anyone with Access 2007 from opening the application as it trys to convert the db without prompting and subsequently corrupts the app. The following bit of code works on the Load event of my switchboard but only if the folder the db resides in is a trusted location for Access 2007. If the folder is not in the users trusted locations, the vba code in the app is ignored and corruption results.

    Private Sub Form_Load()
    Dim MyDBVersion As Integer
    MyDBVersion = 5614
    If Application.Build = MyDBVersion Then
    Exit Sub
    MsgBox ("Invalid version of MS Access" & vbNewLine & "Please start MS Access from Citrix"), vbOKOnly, "Verify Version"
    End If
    End Sub

    Any help would be much appreciated.


  2. #2
    Join Date
    Oct 2009
    well your premise is simply not correct.

    we have plenty of Access applications built in 2000-2003 versions that open fine in 07 with no prompt to convert....

    possibly it is an option - if so - you can have it turned off because we have plenty of people using 07 opening applications build with 02 and 03 all the time with no prompt...

  3. #3
    Join Date
    Dec 2004
    Madison, WI
    As you guessed, you probably need to add the location of the mdb as a trusted location in IE (Internet Explorer) under the Security tab for every user if you want to automate this in code. Otherwise there was a post a few weeks ago on vb code to bypass the trusted zone settings in IE but I wasn't sure if that code would work in vba. But I think the problem is that it must run a type of procedure that's normally done manually and runs 'outside so to speak' the MSAccess environment and thus needs to look at if it can excecute that procedure in the trusted zone setup for the user (controlled in IE).

    For example, for users to run a vb script, they would need to be setup (trusted zone in IE) to point to the network drive to execute a vb script against that network drive since security of the vb script is contained within IE for executing of the vb script within the trusted zone.

    I would second-guess why though that you need to convert/build the application on the fly since again, as NTC pointed out, you don't necessarily need to do the conversion for the user to open the mdb file (2007 will open previous versions without conversion.) I'd only do what you're doing if the frontends where on user's desktops and there were specific problems since upgrading an mdb to a new version usually entails some sort of recoding/fixing somewhere (actual conversions rarely go completely smooth without some fixing of code somewhere.) I wouldn't recommend trying to do these on the fly in code as the user opens the mdb file.

    Also make sure ALL your users have WRITE and READ permissions to the folder as this causes a locked *.ldb file (or corruption as you may term it.)

    You need to define what you mean by corruption as I also think you're using the wrong approach. For example, trying to convert an mdb file while someone else is in that same mdb file will have undesirable affects.
    Last edited by pkstormy; 11-07-09 at 00:32.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts