{"id":532,"date":"2005-10-13T16:33:51","date_gmt":"2005-10-13T08:33:51","guid":{"rendered":"http:\/\/foxpro.ntsl119.com\/scr\/?p=532"},"modified":"2007-10-10T00:58:20","modified_gmt":"2007-10-09T16:58:20","slug":"target-table-is-already-engaged-in-a-relation","status":"publish","type":"post","link":"https:\/\/foxpro.ntsl119.com\/scr\/archives\/532","title":{"rendered":"Target table is already engaged in a relation."},"content":{"rendered":"<p>Imagine this. <\/p>\n<p>You&#8217;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&#8217; data environments.<\/p>\n<p>(You use RELATIONs instead of VIEWs because you feel like VIEWs are for lazy bummers and RELATIONs are cool because they&#8217;re &#8216;old school&#8217;)<\/p>\n<p>Now after hours of creating, re-aligning, adjusting your reports holding more than <font face=\"Tahoma, Verdana, Arial, san-serif\" size=2>10<\/font> normalized tables each. You found out that after going to Tab-<font face=\"Tahoma, Verdana, Arial, san-serif\" size=2>02<\/font> and previewing the report, going to Tab-<font face=\"Tahoma, Verdana, Arial, san-serif\" size=2>07<\/font> fires up this error:<\/p>\n<blockquote><p><font face=\"Tahoma, Verdana, Arial, san-serif\" size=2>Target table is already engaged in a relation.<\/font><\/p><\/blockquote>\n<p>You already have SET RELATION TO in place but still the error shows.<\/p>\n<p>And SET RELATION OFF won&#8217;t work. I wonder why it is even included in the help file. <\/p>\n<p>You &#8216;google-d&#8217; the &#8216;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.<\/p>\n<p>You found a couple of links that are unrelated and refer to problems occuring only in version <font face=\"Tahoma, Verdana, Arial, san-serif\" size=2>4<\/font>. Now you wonder if there was really a version <font face=\"Tahoma, Verdana, Arial, san-serif\" size=2>4<\/font> out there hidden from the minds of the humans which will be used in the up coming alien invasion.<\/p>\n<p>The closest you can get is a link to <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/dv_foxhelp\/html\/err1147.asp\" target=\"_blank\">Microsoft&#8217;s MSDN site<\/a> which you can also find in your help file.<\/p>\n<p>You got irked and you tried to CLOSE DATABASES and fire up your DatabaseInitialization() routine every time you execute the print command. <\/p>\n<p>But then that&#8217;s too lame. Although VFP&#8217;s speed is legendary and the delay is negligible&#8230; you don&#8217;t want to tarnish FoxPro&#8217;s name with a lame code patch manuever.<\/p>\n<p>Now in case in the future someone stumbles upon this problem, decides to search the &#8216;net, wants to join the old-school-frat (when database development tools were dedicated to speed and the proper use of resources and <a href=\"http:\/\/foxpro.ntsl119.com\/archives\/00000522.html\" target=\"_blank\">backward compatibility<\/a>) and is allergic to views, I hope the following steps could be of help.<\/p>\n<p>Fire up LIST STATUS. If it scrolls too fast, dump it in a text file. <\/p>\n<blockquote><p><font face=\"Tahoma, Verdana, Arial, san-serif\" size=2>list status to file SEXYDUMP.txt<\/font><\/p><\/blockquote>\n<p>Survey the tables with RELATIONs. Do a search on the word &#8216;RELATION&#8217;. Note each table name and do a SET RELATION TO in every table in your noted list.<\/p>\n<blockquote><p><font face=\"Tahoma, Verdana, Arial, san-serif\" size=2>select Table01<br \/>\nset relation to<br \/>\nselect Table02<br \/>\nset relation to<\/font><\/p><\/blockquote>\n<p>Once I can find a faster way, I&#8217;ll post. Or if you have one, feel free to <a href=\"mailto:Richard.Base [AT] GMail.com\">e-mail me<\/a>&#8230; and I&#8217;ll be glad to update this. <\/p>\n<p>Of course&#8230; better you learn VIEWs. It&#8217;s an alien technology to begin with.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imagine this. You&#8217;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&#8217; data environments. (You use RELATIONs instead of VIEWs because you feel like VIEWs are for lazy bummers and RELATIONs are cool because they&#8217;re &#8216;old school&#8217;) Now after hours [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,3,10],"tags":[],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-alieninvasion","category-visual-foxpro","category-workblog"],"_links":{"self":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":0,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"wp:attachment":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}