|
 |
access_asp thread: Limting record additions to a number in a field
Message #1 by "Rob Owen" <roamigo2001@h...> on Wed, 8 Jan 2003 17:34:12
|
|
I am trying to start a website up that car dealers can adverise their
stock. I need to be able to limit the amount of cars they can add to the
database depending on a value i set in the user table.eg. I set 30, they
can only add 30 records/cars to the cars table. How can i do this, if it
is possible.
THank You
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 9 Jan 2003 11:26:55 +1100
|
|
Store this value in their user information table.
When they want to add a new car, do a SELECT COUNT(*) (in the Records table)
first to see how many active records they currently have. If it is equal to,
or greater than their maximum, then don't allow them to enter any more.
Something like:
SELECT
a.MaxRecordsAllowed - COUNT(b.RecordID) AS NumRecordsPermitted
FROM
Users AS a
INNER JOIN
Records AS b
ON
a.UserID = b.UserID
WHERE
a.UserID = 1
GROUP BY
a.UserID
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Rob Owen" <roamigo2001@h...>
Subject: [access_asp] Limting record additions to a number in a field
: I am trying to start a website up that car dealers can adverise their
: stock. I need to be able to limit the amount of cars they can add to the
: database depending on a value i set in the user table.eg. I set 30, they
: can only add 30 records/cars to the cars table. How can i do this, if it
: is possible.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by "Carl E. Olsen" <carl-olsen@m...> on Wed, 8 Jan 2003 20:53:11 -0600
|
|
Do a record count with ASP and output a page that says "FULL" when the
database reaches the count.
> -----Original Message-----
> From: Rob Owen [mailto:roamigo2001@h...]
> Sent: Wednesday, January 08, 2003 5:34 PM
> To: Access ASP
> Subject: [access_asp] Limting record additions to a number in a field
>
> I am trying to start a website up that car dealers can adverise their
> stock. I need to be able to limit the amount of cars they can add to
the
> database depending on a value i set in the user table.eg. I set 30,
they
> can only add 30 records/cars to the cars table. How can i do this, if
it
> is possible.
>
> THank You
> to unsubscribe send a blank email to leave-access_asp-
> 1112135Q@p...
Message #4 by "Rob Owen" <roamigo2001@h...> on Thu, 09 Jan 2003 12:37:21 +0000
|
|
Thank You for your response to my query. I am, however, looking for a way
that the database will not allow any moer additions to a specified user.
This is so that if they call me to add a record using a form in the
database, it will not let me add anymore records
>From: "Ken Schaefer" <ken@a...>
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] Re: Limting record additions to a number in a field
>Date: Thu, 9 Jan 2003 11:26:55 +1100
>
>Store this value in their user information table.
>
>When they want to add a new car, do a SELECT COUNT(*) (in the Records
>table)
>first to see how many active records they currently have. If it is equal
>to,
>or greater than their maximum, then don't allow them to enter any more.
>
>Something like:
>
>SELECT
> a.MaxRecordsAllowed - COUNT(b.RecordID) AS NumRecordsPermitted
>FROM
> Users AS a
>INNER JOIN
> Records AS b
>ON
> a.UserID = b.UserID
>WHERE
> a.UserID = 1
>GROUP BY
> a.UserID
>
>Cheers
>Ken
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>From: "Rob Owen" <roamigo2001@h...>
>Subject: [access_asp] Limting record additions to a number in a field
>
>
>: I am trying to start a website up that car dealers can adverise their
>: stock. I need to be able to limit the amount of cars they can add to the
>: database depending on a value i set in the user table.eg. I set 30, they
>: can only add 30 records/cars to the cars table. How can i do this, if it
>: is possible.
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
Message #5 by "Carl E. Olsen" <carl-olsen@m...> on Thu, 9 Jan 2003 06:46:29 -0600
|
|
I think Ken had the answer. You query the database for all records
matching the user ID field (assuming that is the primary key in the
database), and then count the number of records. If the number is 30,
just display some text that says they have reached the maximum number of
records.
> -----Original Message-----
> From: Rob Owen [mailto:roamigo2001@h...]
> Sent: Thursday, January 09, 2003 6:37 AM
> To: Access ASP
> Subject: [access_asp] Re: Limting record additions to a number in a
field
>
>
>
>
>
>
> Thank You for your response to my query. I am, however, looking for a
way
> that the database will not allow any moer additions to a specified
user.
> This is so that if they call me to add a record using a form in the
> database, it will not let me add anymore records
>
> >From: "Ken Schaefer" <ken@a...>
> >Reply-To: "Access ASP" <access_asp@p...>
> >To: "Access ASP" <access_asp@p...>
> >Subject: [access_asp] Re: Limting record additions to a number in a
field
> >Date: Thu, 9 Jan 2003 11:26:55 +1100
> >
> >Store this value in their user information table.
> >
> >When they want to add a new car, do a SELECT COUNT(*) (in the Records
> >table)
> >first to see how many active records they currently have. If it is
equal
> >to,
> >or greater than their maximum, then don't allow them to enter any
more.
> >
> >Something like:
> >
> >SELECT
> > a.MaxRecordsAllowed - COUNT(b.RecordID) AS NumRecordsPermitted
> >FROM
> > Users AS a
> >INNER JOIN
> > Records AS b
> >ON
> > a.UserID = b.UserID
> >WHERE
> > a.UserID = 1
> >GROUP BY
> > a.UserID
> >
> >Cheers
> >Ken
> >
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >From: "Rob Owen" <roamigo2001@h...>
> >Subject: [access_asp] Limting record additions to a number in a field
> >
> >
> >: I am trying to start a website up that car dealers can adverise
their
> >: stock. I need to be able to limit the amount of cars they can add
to
> the
> >: database depending on a value i set in the user table.eg. I set 30,
> they
> >: can only add 30 records/cars to the cars table. How can i do this,
if
> it
> >: is possible.
> >
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
>
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus
>
>
> to unsubscribe send a blank email to leave-access_asp-
> 1112135Q@p...
|
|
 |