Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 To: Jake Pomperada
  Where is Jake Pomperada?
 Bacolod City, Negros Occidental
 Philippines
 Jake Pomperada
Subject: RE: set relation and databases
Thread ID: 186167 Message ID: 186185 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Monday, July 28, 2008 11:33:57 AM         
   



> Thanks sir but my problem I have two tables for example name.dbf and subject.dbf I want to create a one to many relationship? It is possible to use set relation command in this scenario? any ideas or sample code? Thanks and God Bless.

Yes - you must have an key that relates the two tables, and an index onthat key then use the code I gave you:

USE name IN 0 ORDER TAG subject
USE subject IN 0
SELECT subject
SET RELATION TO subject INTO name
SET SKIP TO name


Now you have a one-to-many relation between Subject and Name!

What are you trying to do?

Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA

ENTIRE THREAD

set relation and databases Posted by Jake Pomperada @ 7/28/2008 10:15:20 AM
RE: set relation and databases Posted by irma @ 7/28/2008 10:23:23 AM
RE: set relation and databases Posted by Andy Kramek @ 7/28/2008 10:42:07 AM
RE: set relation and databases Posted by Jake Pomperada @ 7/28/2008 10:49:12 AM
RE: set relation and databases Posted by Andy Kramek @ 7/28/2008 11:33:57 AM
RE: set relation and databases Posted by Jake Pomperada @ 7/28/2008 12:07:12 PM
RE: set relation and databases Posted by Boudewijn Lutgerink @ 7/28/2008 12:15:25 PM
RE: set relation and databases Posted by Marcia Akins @ 7/28/2008 12:33:32 PM
RE: set relation and databases Posted by Christian Tabligan @ 7/28/2008 11:27:11 AM