Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and FPD accessing same FPD tables
Message
 
À
23/04/1998 08:02:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00093193
Message ID:
00094596
Vues:
32
>>Go ahead with local views (we are with FoxPro data). If you have fixed paths to where your FP Dos resides from your VFP DBC, you're lucky. If that's not the case, leave me a note, and I'll tell you a trick.
>>
>>José
>Jose, I'd be very interested to know the "trick". Also, thanks for the reply regarding my disappearing view def's. I'll be examining the results of GENDBC this morning.
>Best, Joel

Joel,

The trick is as follows. First you have to store the path to your 2.6 tables somewhere. The usual thing is either in a .INI file or (prefered) in the registry.

Second, build up your view to act just as you want. Then use GENDBC or better GENDBCX to generate all the code of your DBC. Cut and paste the view definition (not only the SQL part of it, but all the DBSETPROP's also) and save it in a .PRG file. Touch the .PRG to allow for macro substitution, in the following way.

#INCLUDE "c:\cdbk30\common30\include\framincl.h"
LOCAL lcOldSafety

lcOldSafety = SET("SAFETY")
SET SAFETY OFF

*-- this line retrieves the path from the registry
lcTiers = ALLTRIM(GoApp.GetSetting(COMPTADIR_KEY, APPCLASS))+"tiers"
*-- this line was the path when the view was originally built
*lcTiers = "F:\SAARI\AUTOCONS\TIERS"

CREATE SQL VIEW "LV_CUSTOMERS" ;
AS SELECT "400" + SUBSTR(Tiers.comp, 4, LEN(tiers.comp) -3) AS cCode, ;
Tiers.nom ;
FROM &lcTiers ;
WHERE Tiers.comp = "400" ;
AND Tiers.comp <> "400000" ;
ORDER BY cCode

*-- more DBSetProps (cut for clarity)

SET SAFETY &lcOldSafety

Third: be sure to have this .PRG run when the user changes his preferences and wants to connect to other data.


José
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform