Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using COM Objects
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00260730
Message ID:
00260795
Vues:
14
>Hello,
>I needed some guidence in designing some COM based objects that are going to be used in a Web site. The problem I need to solve is in locating the databases during the object's instantiation. When you create an EXE that runs, the Application object sets the path, class libraries, procedures, etc. However, when designing the COM object, the application object is not created and thus the above environment variables are not set. So, what is the best way to go about setting the environment? How do I set the path so that the object knows where to look for the database files? If you have any reading suggestions, they would also be greatly appreciated.


DEFINE CLASS MyClass AS Session OLEPUBLIC
cDataPath = "\\DataServer\WebData\VFP\"
ENDDEFINE

DEFINE CLASS AnotherClass AS MyClass

PROCEDURE MyProc
USE (This.cDataPath + "MyTable") IN 0
ENDPROC
ENDDEFINE


The only problem is that if you move the data, you'll need to recompile.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform