limiting the records in access 2007 or 2010 to 10 users

princess_kay

Registered User.
Local time
Today, 00:30
Joined
Oct 16, 2010
Messages
27
hi, i have a database in access with one table, this table has 2 columns username and password. can anyone tell me how i can detect how many people are in the database - and when it reaches 10, to say database is full please contact admin...:confused:
 
Sorry but that website doesnt help, i have a program which i created in vc++ it's a login app. when users enroll they get put in the database (username and password) i need a sql statement that checks how many users are in a database if there is 10 then no more people can enroll. i need a limit of 10 users. how can i do this...
 
If when the user leaves the database their name is deleted from the table then I would think a simple COUNT of the records would do it. There is nothing build into Access to do that if that is your question. It sounds like you do not have access to the Database source except through your vc++ code, correct? Otherwise you could build the function you need in the db.
 
If when the user leaves the database their name is deleted from the table then I would think a simple COUNT.

users wont be deleted unless absolutely necessary ( the database has 10 users) because they need access to a secured file. i just want a method or function of somekind that can count the amount of users inserted into the database and when it reaches ten to stop
 
Everyone *must* go through your vc++ code right, so how about if you keep track of them in your code? As I asked earlier, do you have access to the MS Access code so you could create your own function?
 
Everyone *must* go through your vc++ code right, so how about if you keep track of them in your code?

thats what i want to do i was just hoping someone could tell me the SQL statement command that can do this. is this the right forum for this?
 
thats what i want to do i was just hoping someone could tell me the SQL statement command that can do this. is this the right forum for this?
It is the right forum but we still need some answers. Do you have access to the source code for the MS Access mdb and are you allowed to alter it?
 
That puts a different light on it. You need to know how many *active* users are logged into the db right?
 
no what happens is a user must enroll (enter a desired username and password) this goes into the database, i want to limit the users enrolling to 10. the users that are enrolled will be able to login by entering the username and password they enrolled with.
 
I'm sorry, I just did not understand your need. It comes with age I understand. So once you have 10 people "enrolled", whether they are currently active or not, that is the limit and no more users can "enroll". Did I get it right that time? :D
 
So you just need to know when the RecordCount of the one table tries to exceed 10 records, correct?
 
I'm sure it is. You need SQL that will do that right? Let me play a bit.
 
SELECT COUNT(*) FROM [YourTable]
...should give you a RecordCount of the table.
 
You just need a *total* count of the number of records right? No WHERE clause needed.
 
Just fyi: this will work as long the table is cleared before the start of the day.
 

Users who are viewing this thread

Back
Top Bottom