Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Views in the DE
Message
 
To
09/10/1997 11:55:32
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00053848
Message ID:
00054016
Views:
35
>>I'm not sure if I understand your problem, but I use views in forms' DEs all the time without adding the underlying tables, or opening them in the default session.
>
>That will not be necessary if you have all the tables in the DBC. In my case, only the view is in the DBC and the tables are free tables.

Michel,

For these cases, I define the view in code and add it to the DBC. I store the path to the free tables in the registry, and have the user define it in his preferences. When leaving the preferences form, I rewrite the view according to the new path. So no need to open the tables before running the view.

Something in these lines:



lcTiers = ALLTRIM(GoApp.GetSetting(COMPTADIR_KEY, APPCLASS))+"tiers"
lcComptes = ALLTRIM(GoApp.GetSetting(COMPTADIR_KEY, APPCLASS))+"Comptes"

***************** View setup for LV_CLIENTS ***************

CREATE SQL VIEW "LV_CLIENTS" ;
AS SELECT Tiers.comp AS ccompte, ;
Tiers.inti AS cintitule, ;
Comptes.lett AS nlettrable, ;
Comptes.bloq AS nutilisable, ;
Comptes.saie AS nsaisieecheance, ;
Comptes.saip AS nsaisiepointage, ;
Comptes.saiq AS nsaisiequantite, ;
Tiers.nom AS cnomtiers, ;
Tiers.ad1 AS cadresse1, ;
Tiers.ad2 AS cadresse2, ;
Tiers.ad3 AS cadresse3, ;
Tiers.cp AS cpostal, ;
Tiers.vill AS clocalite, ;
Tiers.tele AS ctel, ;
Tiers.fax AS cfax, ;
Tiers.modr AS creglement, ;
Tiers.banq AS cbanque, ;
Tiers.pays AS cpays, ;
Tiers.lang AS clangue, ;
Tiers.tva AS ctva ;
FROM &lctiers INNER JOIN &lccomptes ;
ON Tiers.comp = Comptes.comp ;
WHERE Tiers.comp = "400" ;
AND Tiers.comp <> "400000" ;
AND UPPER(Tiers.comp) = UPPER(?vp_cCompte) ;
AND Tiers.cp = ?vp_cPostal ;
AND Tiers.tva = ?vp_cTva ;
AND UPPER(Tiers.inti) = UPPER(?vp_cIntitule) ;
ORDER BY Tiers.comp



José
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform