-
Hi,
I'm new to the database scene. In other words, I know squat! What I'm trying to do is create a password protected, multi-user address book(for the family - where each member of the family would basically have their own address book). How would be the best way to set up my database? Would each (new)user be a (new)table? How would I create a new table from my program? Any help is surely appreciated, because I have a headache trying to figure this database stuff out. I'm using VB5.
Thanks a lot,
Ron
-
In a database you try to avoid storing data multiple times, so if you want to create a database for an adress-book, and your family can login it's very likely you'll get multiple records with the same data if you create a table for each member that can logon.
My suggestion is to create a table with the users (user_id, name, password) and to create a table with the adresses (adress_id, name, adress etc).
To connect the tables you use another table where you store user_id / adress_id information. In that way you only store the data once, and all your familymembers will be able to access their own adress-book.
Good luck
-
Further to mvrp's answer. You have to examine your data and structure it in a logical way. The usual way to do this is to use a process called normalisation. Have you got Access. There is some decent documentation on how to set up one to many and many to many links.
In your case, you might set up a table for each member of your family. You can then set up a table of contacts and a 'junction table' that links members of the family to a contact. Typically you would give each member of the family an ID and each contact an ID, the junction table would contain IDs for each family member and each contact that is applicable to them.
i.e.
Contacts
Joe 1
Mary 2
Simon 3
Family
John 1
Jane 2
If John 'knows' Joe and Mary and Jane 'knows Mary and Simon the junction table would be:
FamilyID ContactID
1 1
1 2
2 2
2 3
You could then use standard SQL to pick up the data you needed (phone #, address etc.)
Hope that helps,
P.