SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 4th, 2001, 03:13 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Count records with SQL & redirect with ASP

<i><b>Originally posted by : Michelle (mrhudy@leiner.com)</b></i><br />Help!<br />I am trying to create code in ASP using SQL - here's the story:<br /><br />I have a registration DB in Access 97 that you can sign up for on our intranet. First, you sign in with your UserID (usrname), then go to the course list. In the form to sign up, you enter the CourseID and then I have code on the summary page that first makes sure it is valid, then it checks to see if your UserID has not signed up for the same course, then enters it in the DB, then displays the new record entry. <br /><br />I want to add code that makes sure no more than 25 people have signed up for the class.<br /><br />This is what I used for the no duplicate entry - can this be modified to use the SELECT COUNT feature and redirect the user if there are already 25 of that courseID in the DB???<br /><br />Dim strRedirect<br />strRedirect = "<script>javascript:window.open('state_search2.asp?usrName= " & strUserName & "','_top');</script>"<br /><br />Set rs = Conn.Execute("SELECT * FROM SignUp " & _<br /> "WHERE SignUp.ID = '"&strUserName&"' "& _<br /> "AND SignUp.CourseID LIKE '"&CourseID&"'")<br />If Not rs.EOF Then<br />Response.Write(strRedirect)<br />End If<br />Set rs = Conn.Execute("SELECT * FROM Employees WHERE ID = '"&strUserName&"'")<br /><br />Thanks a million to anyone who takes the time to help me!<br /><br />

Reply With Quote
  #2  
Old May 9th, 2001, 06:21 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : </b></i><br /><br /><br /><br />------------<br />Michelle at 5/4/2001 1:13:05 PM<br /><br />Help!<br />I am trying to create code in ASP using SQL - here's the story:<br /><br />I have a registration DB in Access 97 that you can sign up for on our intranet. First, you sign in with your UserID (usrname), then go to the course list. In the form to sign up, you enter the CourseID and then I have code on the summary page that first makes sure it is valid, then it checks to see if your UserID has not signed up for the same course, then enters it in the DB, then displays the new record entry. <br /><br />I want to add code that makes sure no more than 25 people have signed up for the class.<br /><br />This is what I used for the no duplicate entry - can this be modified to use the SELECT COUNT feature and redirect the user if there are already 25 of that courseID in the DB???<br /><br />Dim strRedirect<br />strRedirect = "<script>javascript:window.open('state_search2.asp?usrName= " & strUserName & "','_top');</script>"<br /><br />Set rs = Conn.Execute("SELECT * FROM SignUp " & _<br /> "WHERE SignUp.ID = '"&strUserName&"' "& _<br /> "AND SignUp.CourseID LIKE '"&CourseID&"'")<br />If Not rs.EOF Then<br />Response.Write(strRedirect)<br />End If<br />Set rs = Conn.Execute("SELECT * FROM Employees WHERE ID = '"&strUserName&"'")<br /><br />Thanks a million to anyone who takes the time to help me!<br /><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Count records with SQL & redirect with ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT