Re: How do I limit the number of records in a table?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: at (Peter)
Date: 11/26/04


Date: Fri, 26 Nov 2004 18:53:40 +0000

On Thu, 25 Nov 2004 11:04:32 -0600, "Rick Brandt"
<rickbrandt2@hotmail.com> wrote:

>"Richard C." <Richard C.@discussions.microsoft.com> wrote in message
>news:5E6674A7-AE67-46F3-BC05-0CDA1A7CD381@microsoft.com...
>>I want to share a database with another group but want to limit their use to
>> a trial type situation. Therefore, I want to limit the number of records they
>> enter into the main table to 100. How do I do this?
>
>If you use an incrementing ID field as the PK you can set the Validation rule to
><101. After the 100th record they will get errors on attempts to add records.

Well, yes, but if they delete records and then want to add more, or
even start adding a couple of records and think better of it (so the
PK count has been incremented), you will rapidly hear yelling and
screaming. I think that the OP is going to need to keep an
incrementing and decrementing counter somewhere, or set a flag and
count flagged records from an appropriate Select Query before allowing
a new one to be added.

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher


Quantcast