Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2004, 02:22 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP Form

Dear Helpers,

I want to create a user registration form for a meeting with several time slots. One time slot could only allow for 4 users. Ideally as soon as the time slot is full with 4 users, users wouldn't see the time slot as one of the choices when they register.
So I created two tables: timeSlot table and user table
timeSlot table: timeslot ID, timeslot description, and a control for number of users.
User table: userID, userName, timeslotID

The registration form itself contains two fields, user name, and time slot which is dynamically populated from the TimeSlot table when control < 4.

My question is: how does the form update the form timeslot table and user table at the same time? Now when the form is sent, the user table is updated(User name and timeslotID). I also want the control to be increased by 1 at the same time.

Any advice would be appreciated!

Cinderella

Reply With Quote
  #2 (permalink)  
Old June 10th, 2004, 03:53 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi guys, I solved the problem myself. It's so easy actually. I used two recordsets to retrieve and update data. Here is my code in case somebody is interested. The OC_fair table is the table for timeSlots and OC_fair_staff is the table for users. This is a simple form but very useful for inside company trainings, meetings, ...

<%
staff=Trim(Request.Form("staff"))
catID=Trim(Request.Form("catID"))

set rs=server.createobject("adodb.recordset")
sql="select * from OC_fair_staff where (staffID is null)"
rs.open sql,conn,1,3

rs.addnew
rs("staff")=staff
rs("catID")=catID
rs.update

set rs1=server.createobject("adodb.recordset")
sql1="select control from OC_fair where catID ='"&catID&"'"
rs1.open sql1,conn,1,3
control=rs1("control")+1
rs1("control")=control
rs1.update

rs.close
set rs=nothing

rs1.close
set rs1=nothing
conn.close
set conn=nothing
 %>

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP form to XML form confusion jroxit Classic ASP Basics 1 October 24th, 2008 03:20 PM
send parameters from asp page to an asp.net form hastikeyvan ASP.NET 1.0 and 1.1 Basics 2 March 29th, 2008 01:32 AM
Converting an HTML Form to ASP.Net Form k_alidxb75 ASP.NET 1.x and 2.0 Application Design 0 November 30th, 2006 03:26 AM
asp.net form to act like old asp form namaste Classic ASP Basics 0 July 25th, 2003 01:29 AM
asp.net form to act like old asp form namaste VB How-To 0 July 25th, 2003 01:15 AM



All times are GMT -4. The time now is 03:52 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.