Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language 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 August 29th, 2006, 02:11 PM
Registered User
 
Join Date: Aug 2006
Location: Philadelphia, PA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to monocles303 Send a message via Yahoo to monocles303
Default Beginner SQL Programming Question

I am in the process of creating a database that will inventory phone lines. I have 250 offices and each office has a max of 70 lines and 10 types of phone equipment. I did not create one main table because of the 70 lines and several types of equipment per office. Instead, I created 3 tables, one for general office info, one for lines and one for equipment. I have one form for data entry and this form contains 2 subforms (lines, equip). How can I setup this form so that when you enter info on the main form, it is duplicated in the subforms? IE: Office Code is the primary key for both my main table and my line table. On the form and it's subform you must enter this information twice. Once you've entered the info on the main form how can it be duplicated in the same subform field, or better yet a table, so the user does not see duplicate fields?

Monica Harris
Reply With Quote
  #2 (permalink)  
Old September 12th, 2006, 03:47 AM
Friend of Wrox
Points: 793, Level: 10
Points: 793, Level: 10 Points: 793, Level: 10 Points: 793, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2005
Location: OKC, OK, USA.
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts
Default

Monocles303:
Need more information on your Database table design.
The following tables (from your explanation) are:

OfficePhoneTbl: defines 250 locations.
  OfficeIDPK [Primary Key: numeric and sequential]
  OfficeLocation [textfield, defining location, bldg number,etc]
OfficeIDPK OfficeLocation
1 Bldg 5
2 Bldg 6
PhoneLinesTbl: defines the phone lines, only;
  LineIDPK [Primary Key: numeric and sequential]
  LineDesc [textfield, description of line;
LineIDPK LineDesc
1 Voice Line
2 Data Line, T1

OfficeLineTbl: a Joining of the OfficePhoneTbl and PhoneLinesTbl. This table allows for anyoffice to have more than one phone line per office and easy to maintain. Queries are run against this table with the
  OfficeLineIDPK [Primary Key: numeric, unique and sequential]
  LineIDPK_FK [ForeignKey: Primary key of PhoneLinesTbl allows dupicate values in this case 70 lines per office.]
  OfficeIDPK_FK [Foreign Key: Primary key of OfficePhoneTbl is the foreign Key in this table.Defines which line is at this office.]
OfficeLineIDPK LineIDPK_FK OfficeIDPK_FK
1 1 1
2 1 2
3 2 2
4 2 1
For the equipment, not sure what your database is defining equipment, however I would define it in its on table as the Office table and Line table, then establish the relationships...meaning if the equipment is a phonebox, you will have more than one line per phone box and I would imagine you would need the status of that line in that phonebox at a office building.
EquipmentPhoneTbl
  EquipmentIDPK
  Equipment Desc
  PortsPerBox

If you have any further questions, email me.
Hope this helps.
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
xslt beginner question cfflexguy XSLT 4 October 16th, 2007 09:11 AM
I am a beginner in the programming and c# ahmedshawki C# 7 August 9th, 2007 01:42 AM
Beginner Question dkr72 Excel VBA 1 January 18th, 2005 09:37 AM
Beginner question on getting only certain elements EstherMStrom XSLT 5 December 10th, 2004 04:38 PM
beginner question saudyonline General .NET 2 September 21st, 2004 01:56 AM



All times are GMT -4. The time now is 11:21 AM.


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