473,413 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

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.
Jan 28 '16 #1

✓ answered by mbizup

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

Expand|Select|Wrap|Line Numbers
  1. if Date() >=  dateadd("M",3,[SomeDate])  then
  2.   MsgBox "Expired!"
  3.   Docmd.Quit
  4. 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.

7 1352
mbizup
80 64KB
The key code that you will need is along the lines of:

Expand|Select|Wrap|Line Numbers
  1. if Date() >=  dateadd("M",3,[SomeDate])  then
  2.   MsgBox "Expired!"
  3.   Docmd.Quit
  4. 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.
Jan 28 '16 #2
Rabbit
12,516 Expert Mod 8TB
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.
Jan 28 '16 #3
NeoPa
32,556 Expert Mod 16PB
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.
Jan 28 '16 #4
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 .
Feb 4 '16 #5
NeoPa
32,556 Expert Mod 16PB
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.
Feb 5 '16 #6
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.
Feb 29 '16 #7
NeoPa
32,556 Expert Mod 16PB
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.
Feb 29 '16 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Clive Minnican | last post by:
Hi there, I have written an application which uses MS Access for it's database engine. Due to the large size which the database has become I have decided that it would be sensible to use SQL...
4
by: Michael John | last post by:
Dear Oracle Developers, my task is to make up a Oracle View from a Pivot table in MS Access. Given are two tables to join: T_FIRM: FIRM_ABBR VARCHAR2(3 BYTE), FIRM_LONG ...
2
by: Andy Davis | last post by:
After installing Access 2000 runtime on a PC, will an Access database, when opened, automatically use the installed runtime or does the database have to reference the runtime apllication somehow?...
11
by: ritenah | last post by:
I am running this command from a .bat file. "C:\pathToAccess\MSACCESS.EXE" "C:\pathToDatabase\db.mdb" /REPAIR Database repairs as expected, then shows the messge: "Successfully repaired the...
1
by: garry.oxnard | last post by:
Can anyone help me to solve a problem which involves switching from Access to Excel (then back to Access) programatically please? I have an Excel template which, on open, also opens an Access...
4
mmect
by: mmect | last post by:
I'm working on a very basic form and need to know how to add a current date to a field (modified_recommendation) when another field is changed (recommendation). Please let know how i can do this. ...
2
by: LAB | last post by:
I'm using an app designed in Access 2003 which exports a report into a .snp file. We are manually converting the snp files into pdf. I'll looking for away to convert the files from snp to pdf...
1
by: TommyGunn | last post by:
Hi everyone, Is there anyway to automatically put Access data into Mail Merge in an existing Word doc with content? I have bits and pieces of this done, but I can't seem to put it all together....
1
by: james schrag | last post by:
I will attempt to explain my plight once again. I want a particular set of ssi files to execute automatically upon access to my website. I thought that possibly i could make this happen through a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.