Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Application with more DBC
Message
 
À
02/09/1998 10:08:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00132228
Message ID:
00132375
Vues:
11
>>Cetin,
>>I don't known if change only the path or if change path and DBC's name, so I think the 1st solution (change database property) is more useful for my purpose.
>>
>>About the opening of my tables:
>>I haven't to open the table, these are in the DE, the library's form is the base from which the developers create their forms, I'm developing a framework and each VFP project is based on this framework; so I don't known which tables are used, and I don't want to say to each developer to customize the Form.DataEnviroment.BeforeOpenTables() event to change the database property, I would to do this in library...
>>
>>Renato
>Hi Renato,
>You mean (sorry still confused) you have a baseform class, developers use it, add a DE ? If so here is example code :
* Example of code that will decide data path on the fly
>lParameters tcDBCNAme
>close all
>oApp = createobject("myapplication")
>oApp.cDBCFullName = getdir()+oApp.cDBCName
>do form myform name oApp.oTopForm linked
>*....
>*read events
>
>
>define class myApplication as Custom
> cDBCName = "mydbc.dbc"
> oTopForm = .NULL.
> cDBCFullName = .NULL.
>enddefine
>
>
>*** myForm is based on this form class
>*!* DEFINE CLASS mybaseform AS form
>*!* DoCreate = .T.
>*!* Name = "mybaseform"
>*!* dataenvironment = .F.
>*!* PROCEDURE Init
>*!* with thisform.dataenvironment
>*!* .closetables
>*!* thisform.setall ("Database", ;
>*!* oApp.cDBCFullName,"cursor")
>*!* .opentables
>*!* endwith
>*!* ENDPROC
>*!* ENDDEFINE
>Notice baseform class has a property "dataenvironment" that would also let this work with
>oApp.oTopForm = createobject("myForm",createobject("mydataenvironment"))
>with slight modification in form.init (but as I get your developers add DE).
>Cetin

Cetin,
the developers doesn't add DE to a form, but create forms in their project as a normal form, but they have setted the Template Class Form property (in Options Tabbed Dialog) to my form class.
In the class I haven't the DE because the button on toolbar is disabled (so another maybe can be: Can a form class has the DE ?), when you create a form for your project, instead, DE exist and the button is enabled.

hope my poor english doesn't create fog around the problem.
bye.
Renato
Renato Bertuol (EMail:renato.bertuol@elmec.it
Homepage:www.geocities.com/SiliconValley/Horizon/3216)
Elmec Informatica (URL www.elmec.it)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform