Solved

relation beetwen 2 tables

Posted on 1998-08-26
1
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

739 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