Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2004, 02:22 PM
Authorized User
 
Join Date: Jun 2004
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

 
Old June 10th, 2004, 03:53 PM
Authorized User
 
Join Date: Jun 2004
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
 %>






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





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