Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easy - but not!? SQL placed into RecordSource property
Message
From
07/10/2004 11:18:33
 
 
To
07/10/2004 10:18:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00949531
Message ID:
00949562
Views:
10
>The following SQL query works flawlessly for me...
>
>
>
>SELECT company.company,company.address FROM ;
>company WHERE company.cidcomp in ;
>(SELECT DISTINCT Company.cidcomp FROM company INNER JOIN ;
>kent!compdesc ON  Company.cidcomp = Compdesc.cidcomp INNER JOIN ;
>kent!descrips ON  Compdesc.ciddesc = Descrips.ciddesc INNER JOIN ;
>kent!sectorline ON  Descrips.naics = Sectorline.naics INNER JOIN ;
>kent!sector ON Sectorline.cidsect = Sector.cidsect WHERE  ;
>Sector.sector = ( 'Manufacturing' )) ORDER BY company.company
>
>
>
>Now, I need to be able to dynamically place this code into the RecordSource property of a control on my form, but I keep getting an error that "Command contains unrecoginized phrase/keyword." The code I am using is as follows (in the LostFocus event of a ComboBox on the form)
>
>
>
>thisform.olecontrol1.recordsource =" SELECT company.company,company.address FROM ;
>company WHERE company.cidcomp in ;
>(SELECT DISTINCT Company.cidcomp FROM company INNER JOIN ;
>kent!compdesc ON  Company.cidcomp = Compdesc.cidcomp INNER JOIN ;
>kent!descrips ON  Compdesc.ciddesc = Descrips.ciddesc INNER JOIN ;
>kent!sectorline ON  Descrips.naics = Sectorline.naics INNER JOIN ;
>kent!sector ON Sectorline.cidsect = Sector.cidsect WHERE  ;
>Sector.sector = ( 'Manufacturing' )) ORDER BY company.company"
>
>
>
>Can anybody explain to me what I am doing wrong, and how I might be able to get this working as I intend?
>
>Thanks!


VFP don't support this query.

use this:
SELECT company.company,company.address FROM company ;
kent!compdesc ON  Company.cidcomp = Compdesc.cidcomp INNER JOIN ;
kent!descrips ON  Compdesc.ciddesc = Descrips.ciddesc INNER JOIN ;
kent!sectorline ON  Descrips.naics = Sectorline.naics INNER JOIN ;
kent!sector ON Sectorline.cidsect = Sector.cidsect ;
WHERE Sector.sector = 'Manufacturing';
GROUP BY company.company,company.cidcomp
Previous
Reply
Map
View

Click here to load this message in the networking platform