navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

"Registration full" check from database

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> "Registration full" check from database
Page: [1]
 
Advance113

 

Posts: 3
Joined: 4/13/2004
Status: offline

 
"Registration full" check from database - 4/13/2004 10:21:16   
I'm in need of some help figuring out a way to give a notification of a class being full from a registration form, so any help would be greatly appreciated :-)

I'm using frontpage and access (both 2002) to setup the registration, and all is well. However, i'm wondering if there's any way that after say 20 people register, I can give some sort of "registration full" notice, and stop taking registrations, or at the very least stop the database from accepting registrations after the number is met. I've dabbled in asp and php, but I'm hoping there is an easier way so that I don't have to completely learn one of those for this "small" project. Any ideas?

Thanks in advance, and thanks for such an informative forum!
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: "Registration full" check from database - 4/13/2004 12:31:06   
Are you using the DRW in Front Page or are you hand coding the ASP?

Basically you'll want a check against the database that looks for the number of registrants and returns a "full" message if there are already 20 signed up...

The easiest way is to create a unique field (the key field) in Access (an autonumber fileld) that starts at 1...

Then you can open a recordset and check to see what the ID # of the latest entry was... if it's <20 then you accept another registrant, if not you can return a message...

You can even go as far as to dynamically display links to the registration form for each class... and if one already has 20 entries then the link doesn't display....

There are lots of ways to go about it, but you'll need an understanding of the way ASP works, even if you use the DRW. Without the DRW you're in for some hand coding.

_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to Advance113)
Advance113

 

Posts: 3
Joined: 4/13/2004
Status: offline

 
RE: "Registration full" check from database - 4/13/2004 13:48:43   
I'm trying to use the DRW, but it sounds like it's not quite going to be up to the task. Adding the dynamic links would be great, but that sounds like it may be a bit out of my current ASP level :-) Do you by chance have any resources for some simple asp logic queries like the one just to check the recordset for the ID# < 20 problem?

Thanks for all your help!

(in reply to bobby)
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: "Registration full" check from database - 4/13/2004 14:19:35   
dim rsCheck

' set, create and open the recordset

set rsCheck=server.createobject("ADODB.recordset")
sqltxt="Select * from tblClass Where Name='Classname' and ID<20 ;"
rsCheck.open sqltxt, oConn

' if there are no matching records:

if rsCheck.EOF then
 response.write "Sorry, this class is full..."

' otherwise

else
 response.write "Sign up here..."
end if
rsCheck.close
set rsCheck=nothing

oConn.close
set oConn=nothing


That's very simplified, and the table and field names would need to be changed to exactly what's in your DB... also you might need a little more than just response.writing the messages above, but that should give you the idea...

Also, where it references 'oConn' you'll need to set up the DB connection, either using a db Jet engine or DSN...

I'm gonna zap this thread over to the ASP/Database forum. You can use the DRW for most of this, and if you need to you can put the code on the "Spooky Diet" and add the extras...

I'm not well versed in the DRW, but there are many here who are.

You can find a lot of good answers at www.aspfaqs.com, www.4guysfromrolla.com, www.aspin.com

You can also find some prewritten scripts at www.hotscripts.com in ASP... there might be something there that would work for you as well.

< Message edited by bobby -- 4/13/2004 11:20:19 >


_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to Advance113)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: "Registration full" check from database - 4/13/2004 15:49:51   
Or, just do a basic count of records - "Select count(*) as RegNo from table"
Then if RegNo > 20, dont show a registration form.

The obvious issue would arise when many people try to register at once, you could get over 20 if they submitted at the same time.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bobby)
Advance113

 

Posts: 3
Joined: 4/13/2004
Status: offline

 
RE: "Registration full" check from database - 4/14/2004 8:16:43   
Great, thanks for the replies! I'll give them a shot!

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> "Registration full" check from database
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts