Can Access detect when its midnight

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GGerard

    Can Access detect when its midnight

    Using Access2000



    I have an application that is running 24/7 and I would like this application
    to perform some routine housekeeping task at midnight.



    What would be an efficient way of doing this; of detecting when midnight
    arrives? (Without having a form timer check every minute or so to see if
    midnight has arrived yet.)



    Would a CallBack Funtion be useful?



    Thanks

    G.Gerard


  • Salad

    #2
    Re: Can Access detect when its midnight

    GGerard wrote:
    [color=blue]
    > Using Access2000
    >
    >
    >
    > I have an application that is running 24/7 and I would like this application
    > to perform some routine housekeeping task at midnight.
    >
    >
    >
    > What would be an efficient way of doing this; of detecting when midnight
    > arrives? (Without having a form timer check every minute or so to see if
    > midnight has arrived yet.)[/color]

    When it intitiates the first time, see how long it takes to midnight and
    adjust the timer interval to that length. Maybe flag that machine as
    the one to execute the housekeeping.[color=blue]
    >
    > Would a CallBack Funtion be useful?
    >[/color]
    Maybe schedule a machine to fire up at midnight and pass a /x (macro)
    parameter on the command line that lets the app know it is to do the
    cleanup or a user/password combo. See "Startup command-line options" in
    help.


    I'm not sure how a dumb computer can recognize when midnight arrives
    without some sort of timer or scheduler.[color=blue]
    >
    > Thanks
    >
    > G.Gerard
    >
    >[/color]

    Comment

    • Darryl Kerkeslager

      #3
      Re: Can Access detect when its midnight

      On a form's timer event, ask if Now() is equal to midnight; if so, run your
      code, if not, reset the timer to 1000.


      Darryl Kerkeslager




      "GGerard" <ggerard@nbnet. nb.ca> wrote in message
      news:xkn6d.1398 58$Np3.5889585@ ursa-nb00s0.nbnet.nb .ca...[color=blue]
      > Using Access2000
      >
      >
      >
      > I have an application that is running 24/7 and I would like this[/color]
      application[color=blue]
      > to perform some routine housekeeping task at midnight.
      >
      >
      >
      > What would be an efficient way of doing this; of detecting when midnight
      > arrives? (Without having a form timer check every minute or so to see if
      > midnight has arrived yet.)
      >
      >
      >
      > Would a CallBack Funtion be useful?
      >
      >
      >
      > Thanks
      >
      > G.Gerard
      >
      >[/color]


      Comment

      • Darryl Kerkeslager

        #4
        Re: Can Access detect when its midnight

        Alternatively, use the IsWerewolf() function.


        Darryl Kerkeslager



        "GGerard" <ggerard@nbnet. nb.ca> wrote in message
        news:xkn6d.1398 58$Np3.5889585@ ursa-nb00s0.nbnet.nb .ca...[color=blue]
        > Using Access2000
        >
        >
        >
        > I have an application that is running 24/7 and I would like this[/color]
        application[color=blue]
        > to perform some routine housekeeping task at midnight.
        >
        >
        >
        > What would be an efficient way of doing this; of detecting when midnight
        > arrives? (Without having a form timer check every minute or so to see if
        > midnight has arrived yet.)
        >
        >
        >
        > Would a CallBack Funtion be useful?
        >
        >
        >
        > Thanks
        >
        > G.Gerard
        >
        >[/color]


        Comment

        • Darryl Kerkeslager

          #5
          Re: Can Access detect when its midnight

          Oops. Didn't read the "without". Nevertheless, I don't see that as
          inefficient, but, how about setting the on timer to 1000*60*60*24?

          Darryl Kerkeslager
          [color=blue][color=green]
          > > What would be an efficient way of doing this; of detecting when midnight
          > > arrives? (Without having a form timer check every minute or so to see if
          > > midnight has arrived yet.)[/color][/color]


          Comment

          • Trevor Best

            #6
            Re: Can Access detect when its midnight

            Darryl Kerkeslager wrote:
            [color=blue]
            > Alternatively, use the IsWerewolf() function.[/color]

            Only works on full moon, good for two days a (lunar) month :-)

            --

            \\\\\\
            \\ \\ Windows is searching
            \ \ For your sig.
            \ \ Please Wait.
            \__\

            Comment

            • Hank Reed

              #7
              Re: Can Access detect when its midnight

              You are correct in thinking that you do not want to waste all that
              processing time by checking the time every second. Assuming that the
              task does not need to run exactly at midnight, then why not check it
              every 30 minutes or so? After you run the task, set a flag in a table
              for the current date so you know it's done and you won't repeat it.
              Hank Reed

              Comment

              • Darryl Kerkeslager

                #8
                Re: Can Access detect when its midnight

                My bad. I think Ken Getz had written some sort of function like,
                IsWitchingHour( ), but I've lost my copy of the Access Developer's Spellbook.


                Darryl Kerkeslager
                [color=blue]
                >[color=green]
                > > Alternatively, use the IsWerewolf() function.[/color]
                >
                > Only works on full moon, good for two days a (lunar) month :-)
                >
                > --[/color]


                Comment

                • Alan Webb

                  #9
                  Re: Can Access detect when its midnight

                  GGerard,
                  Nope. We did this at Schwab for an app that had to log in to Oracle and
                  pick up some data that was ready after 4am. We could run our job any time
                  after 4am but had to be done processing by 7am when the client's staff
                  arrived. What we did is leave a machine running the app with a form timer
                  that sat idle until the scheduled start time for the job. The only
                  interface was a means to reschedule the job and an options form that let the
                  client enable or disable some of the steps in the job that was run. So,
                  form_timer is what worked for us.
                  We also noticed that running doevents in our loop meant that the machine was
                  fairly responsive otherwise and could be used off-hours as a spare machine
                  even though Access was idling away running our form_timer event.

                  "GGerard" <ggerard@nbnet. nb.ca> wrote in message
                  news:xkn6d.1398 58$Np3.5889585@ ursa-nb00s0.nbnet.nb .ca...[color=blue]
                  > Using Access2000
                  >
                  >
                  >
                  > I have an application that is running 24/7 and I would like this
                  > application
                  > to perform some routine housekeeping task at midnight.
                  >
                  >
                  >
                  > What would be an efficient way of doing this; of detecting when midnight
                  > arrives? (Without having a form timer check every minute or so to see if
                  > midnight has arrived yet.)
                  >
                  >
                  >
                  > Would a CallBack Funtion be useful?
                  >
                  >
                  >
                  > Thanks
                  >
                  > G.Gerard
                  >
                  >[/color]


                  Comment

                  • Jack MacDonald

                    #10
                    Re: Can Access detect when its midnight

                    Can you isolate the housekeeping chores into a separate application
                    and launch that application at midnight using the Windows Task
                    Scheduler?



                    On Wed, 29 Sep 2004 00:28:13 GMT, "GGerard" <ggerard@nbnet. nb.ca>
                    wrote:
                    [color=blue]
                    >Using Access2000
                    >
                    >
                    >
                    >I have an application that is running 24/7 and I would like this application
                    >to perform some routine housekeeping task at midnight.
                    >
                    >
                    >
                    >What would be an efficient way of doing this; of detecting when midnight
                    >arrives? (Without having a form timer check every minute or so to see if
                    >midnight has arrived yet.)
                    >
                    >
                    >
                    >Would a CallBack Funtion be useful?
                    >
                    >
                    >
                    >Thanks
                    >
                    >G.Gerard
                    >[/color]


                    *************** *******
                    jackmacMACdonal d@telusTELUS.ne t
                    remove uppercase letters for true email
                    http://www.geocities.com/jacksonmacd/ for info on MS Access security

                    Comment

                    Working...