Automatically deactivated ms access db.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sachuchem22
    New Member
    • Nov 2015
    • 39

    Automatically deactivated ms access db.

    I have created access application which i want to distribute to many of user. so i want set time limit to access this aplication and after certain date automatically user enable to access aplication mean i want set validity period to use aplication in ms access 07.Is there any way to do this please explain me.
  • mbizup
    New Member
    • Jun 2015
    • 80

    #2
    The key code that you will need is along the lines of:

    Code:
    if Date() >=  dateadd("M",3,[SomeDate])  then
      MsgBox "Expired!"
      Docmd.Quit
    end if
    That would go in the Open Event of the form that opens when the database is launched. This example simply exits the application when the current date is three months past 'Some Date'. Research the DateAdd function syntax and variations.

    There are a variety of methods for setting the 'Some Date', which should be the date the database was first used in it's trial phase. One method would be to have a table that stores the date first used. That field would be blank/null when the database is first distributed. The same startup form Open Event could check that field for a null. If it is Null, populate it with the current date to record the first use. If it is not null, do nothing since that date has already been recorded.

    The code to quit an expired database would then retrieve that stored date to determine whether the 'trial period' was done.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      One thing to be aware of is that anything that is done can be undone by a knowledgeable user. But this is especially the case for Access because Access security is so weak.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        One thing to bear in mind - data stored in the tables of the database is generally easy to interpret and update.

        You may want to consider a database property for storing your information and an obscure and hard to determine function to check the validity of any data stored.

        Comment

        • sachuchem22
          New Member
          • Nov 2015
          • 39

          #5
          Thanks to every one .but is any method or code by which data stored in tables deleted automatically on certain date so that db not work propery .

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            Nothing automatic, no.

            You could write something, but you can't make someone open a database. You could cause code to be run that checks the date against a date after which the database should stop working and disallow the code from continuing (Close the database for instance) when that is detected.

            Comment

            • sachuchem22
              New Member
              • Nov 2015
              • 39

              #7
              Thanks mbizup. I tried code as you say but there is a runtime error '2465' occur with msg ms access doesnot find field in your expression. so can you explain me how I do it .I am new user of access so pls explains in simple language.

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32633

                #8
                There is really nothing further to add at this point as you haven't expressed your requirements clearly enough, or in adequate detail, for further suggestions.

                You may well be inexperienced at Access, but that is no reason you should not ask your question clearly enough for people to help further.

                Comment

                Working...