Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit number of times a db can be accessed

Status
Not open for further replies.

1deadman

Technical User
Feb 27, 2002
17
US
I am trying to limit the number of times that my database can be accessed. I plan to distribute it and would like to apply a trial period of 20 uses. At that point the user would be locked out until he/she has entered a password. Any help appreciated.
 
Create a table

with username and number of time entered ...

on the loading check wich users connected with Currentuser()
and write in the table the count ...
if the counts = the number you want then just close the application with a message ;)

Cheers
Vince
 
Thanks for the response, DreamWalker. I'm in a bit over my head here. It's probably simple for you all. Could you be a little clearer. This database is for home use, not on a network, so I don't believe that I would need to check for current user. I have some idea as to how to do this. The startup form on the db has two command buttons, one to continue in to the main menu (similar to the switchboard), and the other command button takes the user to the registeration form. Therefore, I could make a table to count how many times the user has clicked on the command button to go on into the main menu and when he reaches the limit, disable that button, bring up a message explaining that the trial period has expired, and the only two options that the user will have is to click on the register button or quit using the db. The one thing that I am not sure how to do is "write in the table the count". Would you please explain further?
 
To elaborate on Dreamwalker's idea, create a small table with one field...I called my test tblCount and the field EntryCount. Now, I went a different way. I went into the table and set the one record there to 20. I then created a text box on the form that is bound to tblCount.EntryCount (CountrolSource = tblCount![EntryCount]. I set the Enabled property of this box to No. Then, every time the continue button is pressed, but after you open the main menu, simply do:

Me![EntryCountBox] = Me![EntryCountBox] - 1

By using this method, you check for the box to be zero before you open the main menu. And you set an OnOpen preperty of the form to check for this box....if 0, then disable the continue button.

One benefit of using the count down like this is you can still display the box (remeber it is disabled!!! no user intervention but it can be seen) and let the user know how many times they have left to enter the program.

Hope I am clear enough. If you need more, please let me know. "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." Albert Einstein. [spin]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
Thanks Robert. I think I have it. Let me play with it for a little while.
 
1deadman,

I have a small test database that has all the above done for you. I will gladly send it to you. Just give me your e-mail address.... "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." Albert Einstein. [spin]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
There is also another way to do this, follow this link


Using a table will work fine, The way the link describes uses code and database properties so no one can manipulate the table that you use to keep track of the uses in.

If you have any questions let me know.

hth Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
This is waht iam trying to do with a random number, so access generates a rnd number and access what look up the answer e.g entry = rnd + 5 * 3 /2 or a admin password.

as the people before me create a table, i created a marco that runs once the startup forms loads and +1 to use count if use count is over ? then it disables the controls.

let me know whitch part you are stuck on and i will send what i have done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top