Home » Archives » February 2005 » Target table is already engaged in a relation.

[ Previous entry: What's New in VFP9 Online Book ]
[ Next entry: Not the end after all... ]

Target table is already engaged in a relation.

Imagine this.

You're working your arse off in a form with multiple tabs with each tab having their own reports with spider-like relationship settings in the reports' data environments.

(You use RELATIONs instead of VIEWs because you feel like VIEWs are for lazy bummers and RELATIONs are cool because they're 'old school')

Now after hours of creating, re-aligning, adjusting your reports holding more than 10 normalized tables each. You found out that after going to Tab-02 and previewing the report, going to Tab-07 fires up this error:
Target table is already engaged in a relation.
You already have SET RELATION TO in place but still the error shows.

And SET RELATION OFF won't work. I wonder why it is even included in the help file.

You 'google-d' the 'net. Taking you to places that list errors but with no definite answers because probably this was an easy problem and was solved years before.

You found a couple of links that are unrelated and refer to problems occuring only in version 4. Now you wonder if there was really a version 4 out there hidden from the minds of the humans which will be used in the up coming alien invasion.

The closest you can get is a link to Microsoft's MSDN site which you can also find in your help file.

You got irked and you tried to CLOSE DATABASES and fire up your DatabaseInitialization() routine every time you execute the print command.

But then that's too lame. Although VFP's speed is legendary and the delay is negligible... you don't want to tarnish FoxPro's name with a lame code patch manuever.

Now in case in the future someone stumbles upon this problem, decides to search the 'net, wants to join the old-school-frat (when database development tools were dedicated to speed and the proper use of resources and backward compatibility) and is allergic to views, I hope the following steps could be of help.

Fire up LIST STATUS. If it scrolls too fast, dump it in a text file.

list status to file SEXYDUMP.txt
Survey the tables with RELATIONs. Do a search on the word 'RELATION'. Note each table name and do a SET RELATION TO in every table in your noted list.

select Table01
set relation to
select Table02
set relation to
Once I can find a faster way, I'll post. Or if you have one, feel free to e-mail me... and I'll be glad to update this.

Of course... better you learn VIEWs. It's an alien technology to begin with.

Disclaimers are for castrated EARTHLINGS.
Powered: GREYMatter | GM-RSS








February 2005
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004

GEEK count:
visitors since the aliens rebooted the counter last 02.23.2006 (was around 33,000++ before the alien intrusion | SINCE: 02.26.2004)