Hi Lynn,
Nice to meet you too. I gather you came from the world of Paradox. That's
where I got my feet wet in database programming too.
I miss the "hey" days of SoCalPALS and PdoxInformant. There use to be some
fun groups that met monthly around SoCal. I stopped upgrading when Borland
passed the ball to Corel.
In practical terms there is not a lot of difference, but there is little, if
any, reason to have CompanyID as part of the Primary Key for tblDivisions.
Since Access has to maintain an index anyways (in either of the above
examples) I figured why not just have the table's primary composite keep all
companies and their related divisions together (saving Access from one
additional sort maintenance). One good reason I can think of to put
DivisionID(PK) first in line is to make use of Access' autoNumber property
but then... that raises another question for me.
Pdox had the autoIncrement data type also but (for lock control reasons) it
was not favored in a networking environment (a requirement for my app) so
the standard procedure was to generate primary keys through a utility table
on the side (where locks could be controlled). Does Access' autoNumber data
type "really" have networking lock issues secured (no two users anywhere on
the the network can ever generate the same primary key at the same time...
period... no ifs, ands, or buts) or is it still wiser to generate primary
keys thru a utility table on the side?
It's purpose in tblDivisions is not to uniquely identify a record in that
table (since it will appear multiple times), but to provide a means of
relating records in tblDivisions with records in tblCompanies. It fits the
definition of a Foreign Key very well. If you are concerned about
duplicates, you can always add a compound Unique Index on DivisionId and
CompanyID.
Please refresh my memory (I'm sorry, I really did read every single page of
the first four parts of Viescas' book... but I read it really fast). Are
you saying that (even though during the table build process I designate BOTH
CompanyID and DivisionID to be PKs) there's an additional step I need to
take to let Access know this is in fact a compound PK (Access doesn't assume
it)?
One of the things you might consider doing here is to consider an
individual that represents himself as a company. For example, where I work,
I am an employee AND a vendor. My employee ID is actually stored in our
Vendor's table. That allows the company to pay my expenses through our AP
system. There is a field for vendor_type in our Vendor's table. I'm of type
"Employee", whereas normal vendors are of type "Vendor". You could add a
field for company_type to tblCompanies and then they become a company
contact. Just a thought that might help simplify some things for you.
That is how I designed my Contacts table back in the 80's. The following is
a partial of that table structure:
tblID
IDnum (smallInt, PK)
LastName (alphanumeric80) <-- or company name
FirstName (alphanumeric50) <-- or company division
MidName (alphanumeric20)
Sex (alphanumeric1) <-- M=Male, F=Female, B=Mr & Mrs, C=company
Sex didn't account for an IDnum to be BOTH Female and Company but that's
something I'll take care of this time around. Besides, back then, (if
Sex=C) I didn't care if an individual was Male or Female... uhhhh no reading
into that last statement please

)
Anyhoo, since I'm designing from scratch again anyways, I'm was planning on
tightening up my table definitions. Are you saying my old approach is still
good? I did have some form and report design issues with that table
structure (they weren't insurmountable... more of a pain in the butt). One
thing's for sure (with the old structure), my ID reports will print out as:
Adams, Linda
Baron, Joe
Company1, Division1
Company1, Division2
Company1, Division3
Dickens, Beth
instead of
Adams, Linda
Baron, Joe
Company1
.........Division1
.........Division2
.........Division3
Dickens, Beth
I'm assuming you do home construction for individuals, like me and John and
tina, and also do commercial construction for companies. Is this correct?
Or, is the Company someone who deals with the homeowners separate from you?
Or is it a combination of the two?
All of the above PLUS there's another company type (Construction Management)
that holds a position in a communications relationship path BUT NOT IN a
financial/accounting relationship path. No biggie, I'm able to handle that
one on my own... famous last words

)
I'm still thinking making the individual
a part of tblCompanies might simplify things here.
One thing I'm nervous about with this approach is... I have a feeling
(sometime, somewhere to perform some database related job WHILE keeping
everything tight and normalized)... I'll have to reference a table to
itself... and (currently) I'm having a hugh problem grasping the
"constructive use" of that concept (with databases). Ya see, I'm also a
musician. A table referencing itself (my interpretation) is the same as me
standing in front of my amplifier holding my guitar. The sound comes out
the speakers and goes back into the guitar's pickup... a continual,
regenerating loop ("feedback" in sound reinforcement terms). I understand
(when managed properly) feedback can sound as sweet as Stairway To Heaven
but, improperly, it sounds like the Sex Pistols. With regards to databases
I want my application to sing like Stairway... not honk like the Sex
Pistols. I'm insecure with self references... I do have an ego though

)
Well, that's an interesting scenario that I've never encountered. In that
case you could use the multi-one-to-many resolver table that I described to
make the connections.
Oh yeah... the re-solv-er (wasn't that the name of a Beatles album?)
table. I had a question about that (I forgot to ask the last time).
Ref your quote:
====================
tblTelephoneConnections
TelephoneConnectionsID (PK)
CompanyID (FK)
DivisionID (FK)
ContactID (FK)
TelephoneID (FK)
Every record in this table will have, either, a CompanyID/TelephoneID,
DivisionID/TelephoneID, or ContactID/TelephoneID combination but no 2 of
those. I can then get to all Company specific telephones by querying where
DivisionID Is Null and ContactID is null, etc.
====================
The "but no 2 of those" part threw me. I know it's probably some
rediculously simple concept but could you explain that again... slower...
for me... please... (easy on me, it's been years since I've been working
"routinely" with basic database procedures, methods and rules)
I understand that, but I still think you will find that a single phone
number is tied to some single entity somewhere.
Correct... multiple times... got it!
It can probably be done but the more levels you add to something like that
the more difficult it is to maintain AND, most importantly, to built data
entry forms that will allow for correct update and insertion of records.
Understood... smart planning... don't reinvent the wheel... be careful.
OK... Lynn-ette... here's a couple of new ones:
1)======================
Please feel free NOT to spend time on this one (if you're not familiar with
Viescas' Access 2003 Inside Out). I sent the following to MS Press'
support several times but I don't think they like to answer support
questions:
Reference MSPress Access2003 Inside Out
I'm building my first project from scratch using the table structures on the
book's companion CD as a guide. In design view, I'm not quite understanding
what the LENGTH property of a column(field) does. The closest explanation
of LENGTH (I found) is on page 615 (first paragraph); "restrict the length
of data entered to no more than"... (the number of characters entered for
this property I'm assuming). But that is not how the field appears to
function in tableview (ref: tlkpContactEventTypes on the book's companion
CD).
Ref: tlkpContactEventTypes
Column = ContactEventFollowUpDays
Data Type = smalint
Length = 2
Length = 2 leads me to believe that 99 is the largest integer allowed in the
field but tableview shows entries for 360 (I was also able to modify a rec
and post a value of 4500). What am I misunderstanding?
2)======================
Pdox (I'm sure remember) generated individual files for tables, forms,
reports, primary indexes, sencondary indexes, validity checks, etc. I had
about 30 or 40 tables tied to my old design application (generating hundreds
of support files). Table sizes ranged from 2 (smallest) to 150,000
(largest) records with most averaging about 1500 to 3000 records. All this
stuff I use to keep in one subdirectory. I see Access not only handles all
database support in ONE .mdb file (thats cool) but also has the capability
to have MULTIPLE .mdb files interact with each other. What I need to know
is (given the table sizes of my application and the fact that this app isn't
going out to market), do I put everything into one .mdb or more than one
(i.e. Contacts.mdb, Sales.mdb, Purchases.mdb, jobCosting.mdb, etc.)??? If
it matters, some point in the future I'll probably upsize to SQL... just
because guitar players like to dink around

)
Lynn, thank you very much for holding my hand
yisturday i didint no howe ta spel aplikasion divelupper... taday i r
wun.
THANX again for your time... (^_^)