Help with DataSelection and Placement into Table

Results 1 to 2 of 2

Thread: Help with DataSelection and Placement into Table

  1. #1
    Eric Lebetsamer Guest

    Default Help with DataSelection and Placement into Table

    I am Building a Conference Room Scheduler for my intranet. I have it built and working but the problem is that I am making 120 connections to the database at once. As you can imagine this gets very slow. This is only temporary but I had to make it work for now. The reason I make 120 connections is because I am using 120 select statements to pull the data for each room and date and time slot. I have time slots in half n hour intervals. Starting at 7:00 am to 6:30 pm. And I have 4 rooms. That is what gives me the 120 connections. I know that there must be a way to only pull one recordset then do something like:<BR>room1a=recordset("room")=Room1<BR><BR>but I have not found a way yet. Please if anyone can help, let me know. Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default RE: Help with DataSelection and Placement into Table

    You seem to have posted this questino every where!<BR><BR>Here&#039s what I&#039d do. Create three tables, one for the rooms, one for time slots and one for the details of who&#039s booking it.<BR><BR>Table 1 - Room<BR><BR>RoomID : AutoNum : Primary Key<BR>Room Name : Text : Title of the room<BR>Size : Number : Room size in number on seats<BR>Cleaner : Text : Cleaners name :)<BR><BR>Table 2 - TimeSlots<BR><BR>SlotID : AutoNum : Primary Key<BR>TimeName : Date/Time : Time slot<BR><BR>Table 3 - Users<BR><BR>UserID : Primary Key<BR>SlotID : Foreign Key from TimeSlots<BR>RoomID : Foreign Key from Room<BR>Name : Text : Users name<BR><BR>Now use just one SQL statement and one connection to do all the work.<BR><BR>List all room with time slots if taken :<BR><BR>SELECT Room.Name, TimeSlots.TimeName, Users.Name<BR>FROM Room, TimeSlot, Users<BR>WHERE Room.RoomID=Users.RoomID AND TimeSlots.SlotID=Users.SlotID<BR>ORDER BY Room.RoomID, TimeSlots.SlotID<BR><BR>That should do it.<BR><BR>Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •