Solved

relation beetwen 2 tables

Posted on 1998-08-26
1
139 Views
Last Modified: 2010-04-30
What is the best method to relation 2 tables from the same database?Give me some code please.

thanks
Alberto

0
Comment
Question by:asimoes
1 Comment
 
LVL 1

Accepted Solution

by:
JayMerritt earned 100 total points
ID: 1431108
For permanent relationships:
In native ACCESS for MDB files, there is a relationship painter that is quite nice and saves the relationships with the MDB file.  Cascade deletes are well supported.  This tool does not require code.


For SQL Server, you will need to use triggers to manage the relationships.

For temporary relationsips:
Use a SQL SELECT statement with a WHERE clause like
  SELECT *
  FROM tblTableA, tblTableB
  WHERE tblTableA.Key = tblTableB.Key

Access also has a QBE tool for painting these Inner and Outer JOINs.  You can copy the SQL from the QBE by looking at the SQL option instead of the DESIGN option.
 
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now