Article View: borland.public.vdbase.data.sql
Article #198Re: SQL Question
From: Robert
Date: Wed, 06 Jan 1999 00:00
Date: Wed, 06 Jan 1999 00:00
66 lines
3298 bytes
3298 bytes
HI Just to thro in something else here. complex relations. I have two... and more tables each have 5 two digit alpha fiels that need to be related. Use the master detail and master fields, seperating the fields with semi-colons, as sugested, does not give me the desired result. The resulting "rowset" is always only related on the first field. eg icode1;icode2;icode3;icode4;icode5 when the combined values of these fields change, mostly the last to the first, then one would expect the child table to follow, not so, only when the first field changes does the child table follow. I have since created a calculated field and used this fied to do the relation on. ps i do have the correct index set up Robert Craig Veal wrote in message <368D3114.82F8A14A@cfi.net>... >I've tried to follow the CLASS DATAMODULE EXAMPLE from OLH, but still >can't make this beast do what I want it to! > >I have a table of clients (companies) that each have a unique id (COMPID >- numeric). I have a 2nd table (XREF) of cross references that contains >only COMPID (numeric) and AGENTID (numeric). The 3rd table contains >agents with a unique id (AGENTID - numeric). > >The form has 2 grids on it (one with clients and the other with >agents). Each client can have multiple agents and each agent can have >represent multiple clients. The XREF table contains ONLY those agents >who have 1 or more clients. > >I have successfully set up the 3 rowsets and the XREF rowset properly >responds when the clients rowset pointer is moved and restricts itself >to just the agent numbers (AGENTID) that correspond to the company id# >(COMPID). The agents rowset does NOT show the correct agents. > >The sql reference is an external sql file produced by the sql designer. >When it is run by itself, the resulting rowset is correct, but when >placed on the form, the agents rowset is wrong. > >The sql designer produced the following (contained in XREF.SQL) >SELECT Agents.AGENTID, Agents.NAME, Agents.CITY, Agents.STATE >FROM "agents.dbf" Agents > INNER JOIN "xref.dbf" Xref > ON (Agents.AGENTID = Xref.AGENTID) , "clients.dbf" Clients >WHERE (Agents.AGENTID = Xref.AGENTID) > AND (Xref.COMPID = Clients.COMPID) >ORDER BY Agents.NAME > > >I tried to force a reevaluation of the rowset by reassigning the sql >pointer to itself (form.agents1.sql = form.agents1.sql). This appears >to be forcing the rowset to reevaluate the sql link (lots of hard drive >activity), but the resulting records do not match what the should be >(wrong agent names). How do I reset the sql link to make it reevaluate >the agents? > >Thanks in advance! > >Craig >Gator Custom Software >------------------------------------------------------------ >"If A Computer Crashes In Cyberspace, Does It Make A Sound?"
Technical Details
Message-ID:
<76v2e9$cdd3@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<368D3114.82F8A14A@cfi.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,2e1c13aae25a9cd4 X-Google-Attributes: gidff5a1,public From: "Robert" <me@u.com> Subject: Re: SQL Question Date: 1999/01/06 Message-ID: <76v2e9$cdd3@forums.borland.com> X-Deja-AN: 429326591 References: <368D3114.82F8A14A@cfi.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.vdbase.data.sql