Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application with more DBC
Message
From
02/09/1998 11:26:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00132228
Message ID:
00132398
Views:
10
>>>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,
No problem with English but I still couldn't get how exactly tables are opened. Your form class doesn't have a DE OK. A form class cannot have a DE but a DE could be added (referenced). If users are using form designer (and their form template is set to your form class) they would have DE automatically. I think you do it this way. Or there should be somewhere where you open tables (load ? a custom dataenvironment class ?). It doesn't matter much though. All you need is to show correct DBC, either for tables in DE or opened elsewhere.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform