Results 1 to 2 of 2

Which front-end gets there first

  1. #1
    knarfreppep is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Adelaide, Australia

    Which front-end gets there first

    Hello everyone!

    I have a front-end/back-end application.

    I want a front-end to compact the back-end each morning.

    Obviously the front end which will do the job must stop other front-ends from proceeding.

    I figure there's some chance of two front-ends trying at exactly the same time.

    So I'm thinking I'll generate a large random number and let the front-end with say the biggest number proceed if there are two or more.

    So my question for very clever mathematicians is: what are the odds of the code below returning the same number from say 10 front-ends please? -

    Public Function sngNumber() As Single
        sngNumber = 2000001 * Rnd + 1000000
    End Function

  2. #2
    ridders52's Avatar
    ridders52 is offline Voodoo Is Practised
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Somerset, UK
    I had to read this several times before (hopefully) understanding it.
    I think you are talking about several users each running their own copy of the FE.
    If so, I suggest you scrap your randomise idea and do it differently.

    Run a scheduled task from the server to compact the BE at a time when nobody is using it e.g. 02:00.

    Or if that's no good for your situation, add a field which stores when the BE was last compacted.
    When the FE is opened, the field value is checked.
    If the date is not the current date, run the compact and reset the date. Otherwise exit that code.

    It is not a good idea to have other users login whilst compacting is being run.
    Colin (Mendip Data Systems), Website, email
    If this has helped, please click the star button and leave a comment

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Different front ends
    By cbende2 in forum Misc
    Replies: 5
    Last Post: 06-01-2015, 11:40 AM
  2. Front End
    By rosscortb in forum SQL Server
    Replies: 3
    Last Post: 03-06-2015, 01:54 PM
  3. Front end help
    By hrenee in forum Reports
    Replies: 6
    Last Post: 10-21-2013, 10:28 AM
  4. front end changes take forever
    By survivo01 in forum Programming
    Replies: 4
    Last Post: 04-19-2013, 12:26 PM
  5. Front end changes
    By Guitarzan in forum Access
    Replies: 3
    Last Post: 08-06-2012, 05:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Tech Forums: Microsoft Office Forums