|
-
Jul 4th, 2007, 01:33 AM
#1
Thread Starter
Junior Member
[RESOLVED] relationships=)
How to relationships for database works.?
Any conditions needed for datalink.?
Care to explain anyone.?
-
Jul 4th, 2007, 02:42 AM
#2
Re: relationships=)
i can give a small primer:
a relationship is a link between one table and another.
Say you had a table full of softdrinks(with a primary key)
and another table with a list of names and the softdrink they like.
since more than one person can like the same softdrink, the softdrink table would have a one-to-many relationship with the drinker table
a one-to-one relationship is basically like having a list of cars and a list of license plates with a common index number. Each car only has one number assigned to it, and each plate only goes on one car. That is a one-to-one relationship.
A many-to-many is the final type of relationship. An example would be a menu at a restaurant related to customers. Each customer could want any thing off of that menu and each menu item could feed any customer,so the menuitem table would have a list of customer reference numbers and there could be duplicates because a particular customer could like more than one menu item, and the customer table could contain duplicate entries in the reference to the menu table because a particular menu item could be the favourite of multiple customers.
I hope this helps a little.
Basically a one to one no duplicates allowed on either side
one to many, duplicates allowed on one side but not other
many to many, duplicates on either side.
-
Jul 5th, 2007, 01:00 AM
#3
Thread Starter
Junior Member
Re: relationships=)
thanks, Lord Orwell.
Basically, you explained to me what are the different types of relationships to link tables right?
I think i understand this part. 
What if 2 tables, both have primary keys, but the primary keys aint the same, but the names are the same, although some may not be in the 2 tables, can i link them together.? just linking the names together?
-
Jul 5th, 2007, 01:18 AM
#4
Re: relationships=)
a relationship doesn't have to be between primary keys. You can choose any column when creating the relationship. I believe you would NOT enforce referencial integrity in this case because data doesn't match in all of them. There is also what's known as an append query that stacks all the data together. Useful for pulling data from two tables and making a 3rd out of it.
-
Jul 5th, 2007, 02:37 AM
#5
Thread Starter
Junior Member
Re: relationships=)
that sounds right. haha. ok. i gonna try this, without the referencial integrity. After this, i would have to try and to display the correct data in CR.
-
Jul 5th, 2007, 09:01 PM
#6
Thread Starter
Junior Member
Re: relationships=)
hmmm. i have successfully changed the relationship. I can see the link in my Access Database, but there isnt any change in the VB.
How can i link the database properly to the VB.?
Any one HELP!!
-
Jul 5th, 2007, 09:54 PM
#7
Re: relationships=)
I wish i could help. The only database use i do is in Access. There are a couple of self-proclaimed Office Gurus on the forum. Start a new thread in Office Development and i am sure you won't have to wait long. One of them is on every day.
-
Jul 6th, 2007, 12:43 AM
#8
Thread Starter
Junior Member
Re: relationships=)
hmm. i think the problem now is more on the VB side ya. cause VB cant seem to recieve the updates that i have made. Do i have to like remap the directory of the database? Copy the database to other folders in the Project?
-
Jul 6th, 2007, 01:19 AM
#9
Re: relationships=)
must be some way to refresh it. a flush command? When you work with databases inside Office, the stuff is automatically saved as you are typing.
If you open it up in Access is the change there? If so, try closing the link and reopening. Now i don't know if this is the best way or not. Let me see if a guru is on line...
-
Jul 6th, 2007, 01:24 AM
#10
Re: relationships=)
What is it that you are trying todo? Database relationships are a big topic. Which db are you using?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 9th, 2007, 09:50 PM
#11
Thread Starter
Junior Member
Re: relationships=)
i am using Microsoft Access. I am trying to link tables together so they can see each other data based on a primary key(or other fields if possible). The problem now is that i can somehow link them together, not by primary key, just by a field with the same company name, and in access i can see the link, and it can browse the data from the other tables. BUT, in VB, i am doing reporting too, i search and display the results in a crystal report, this is where the data needs to be taken from the database. The data extracted is not the right data, that i have linked in the database. I tried refreshing the connection, but it didnt work. So, i am in a big mess.
-
Jul 12th, 2007, 02:20 PM
#12
Re: relationships=)
Just because you link them in the db doesnt mean that any query from CR or other will return that same structured data. You need to create the query with the proper design to return what you want.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 12th, 2007, 08:04 PM
#13
Thread Starter
Junior Member
Re: relationships=)
ohoh. ic haha.i will give it a try =) . Thks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|