Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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 Display Modes
  #1 (permalink)  
Old August 7th, 2003, 05:24 PM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reuse of ASP Code

I have created an online scheduling program (consisting of 14 .ASP files) for the nursery at the church. I need to do the exact same thing for 7 more functions (ushers, acolytes, etc). I am using FrontPage and am wary of <-include-> type statements due to the way FrontPage handles them. All of the functions will be identical other than populating different Schedule tables in a common database. Looking for ideas for how to do this the "RIGHT" way.

Rich
__________________
Ego is a faithful friend; He stays with us all the way to the crater.
Reply With Quote
  #2 (permalink)  
Old August 8th, 2003, 08:44 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cant you pass different parameters to the same scheduling program for each category? like for example cant you query the db through the scheduling program for ushers to use the scheduling for ushers? etc., whats the db structure like? does each category has its own table?

Reply With Quote
  #3 (permalink)  
Old August 8th, 2003, 09:19 AM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I currently have 4 tables:
     Members
     Events (ID, EventDate and ServiceDescriptionID)
     ServiceDescription (ID, ServiceDescription)
     NurserySchedule (ScheduleID, EventID, MemberID)

If I understand your suggestion, create a variable for the table name for modification of the type: (JavaScript)

var ScheduleName = new Array("Usher","Acolyte","Greeters")
var TargetTable = ScheduleName[0] + "Schedule";
INSERT INTO TargetTable
   ....

and add the tables UsherSchedule, AcolyteSchedule, GreetersSchedule, etc.

Would it make more sense to have multiple tables, one for each "function", or put a FunctionID (Usher, Acolyte, Greeter...) into the existing (renamed) Schedule Table and have 1 table hold all schedules?


Reply With Quote
  #4 (permalink)  
Old August 8th, 2003, 09:33 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No I didnt mean that, where are you storing all your categories? is there a separate table for the categories? something like categories and have entries like ushers etc.,

Reply With Quote
  #5 (permalink)  
Old August 8th, 2003, 09:39 AM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Currently, the NurserySchedule is the only one that exists. I have generated all the code I need for additions, deletions, modifications, etc. I need to do the same for the other functions, and rather than just copying the existing code 6 times, I am trying to design a more "elegant" solution

Reply With Quote
  #6 (permalink)  
Old August 8th, 2003, 09:49 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

On a quick thought the elegant way(again this is a 'quick thought') would be something like this

     Members
     Events (ID, EventDate and ServiceDescriptionID)
     ServiceDescription (ID, ServiceDescription)
     Categories(Categoryid,Categoryname)
     Schedule (ScheduleID, EventID, MemberID,Categoryid)
In that way you can create new categories and at the same time use the same code to schedule any of the categories.

Reply With Quote
  #7 (permalink)  
Old August 8th, 2003, 11:20 AM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I like this setup. Eventually I am going to do a "MySchedule" button for the members to print out their own schedule. This setup will make that search much easier in 1 table rather than in 8.

Thanks for your help!

Reply With Quote
Reply


Thread Tools
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
Updated Wrox Code Reuse Policy jminatel Wrox Book Feedback 2 July 1st, 2013 08:30 AM
Reuse Forms and part s of code thillai Visual Basic 2005 Basics 5 March 4th, 2008 10:40 AM
How to reuse my application ankur_bhargava2000 VB How-To 1 October 17th, 2005 01:49 PM
Reuse in ASP. rupen Classic ASP Basics 3 June 29th, 2005 11:12 AM



All times are GMT -4. The time now is 06:10 PM.


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