Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Data Environment
Message
From
02/03/1999 13:32:39
 
 
To
02/03/1999 13:20:49
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00192388
Message ID:
00193257
Views:
24
If DE.AutoOpenTables=.T. then DE.BeforeOpenTables event is appropriate place. If
DE.AutoOpenTables=.F. and you fire DE.OpenTables programmatically from some form's event (init ?) then you may fire the same code right before it. Also, you may still put the code to BeforeOpenTables event and just call:
This.DataEnvironment.BeforeOpenTables()

>Hi Ed,
> I am working on a project where their are two copies of the DBC I want to use. To use the DBC (and associated files) in the alternate location, I turn auto open off, and manually open the DBC and files. In this case, DE.BeforeOpenTables does not fire, so I ended up moving the SetAll() code into the init or the openfiles events aswell. Is there a better way to do this? ie. How do I change the path for the DE, before the DE is opened, when it seems like the DE is the very first thing opened in a form? Thanks.
>
>Daniel
>
>
>>Usually, it's recommended to reset these paths in DE.BeforeOpeTables event(s)
>>Thisform.SetAll("Database",cDbcpathname,"Cursor")
>>It works straightforward if all DE.cursors are dbc-ed tables. If some cursors associated with free tables, then this code should be adjusted.
>>
>>>OK, Jack, but what *do* you do about the hardcoded paths in the DBC????
>>>
>>>Bonnie
>>>
>>>>We have a different drive letter for our test server than our production server. However, we still use the DE in the forms, but set our paths in the main prg. We have found that this works for everything except the hard coded paths that end up in a DBC...
>>>>
>>>>Jack
>>>>
>>>>>>The property is disabled in the property sheet, but it is Writeable at runtime, onlye before the tables are open. So you have to call oyur code in the form.load or the DE.BeforeOpenTables method.
>>>>>
>>>>>OK, that makes sense.
>>>>>
>>>>>>IN response to your question in the other thread: The main advantage to using the DE is being able to visually manage what tables are available to your form's datasession. You can work without it, sure, many do. But you will have to write something that performs the tasks for you: locating and opening the tables.
>>>>>
>>>>>I've been programming for so very many years that writing code to perform these particular tasks is a no-brainer, it's something I've always had to do anyway. Hard to teach an old dog new tricks I guess.
>>>>>
>>>>>Thanks for your input,
>>>>> Bonnie
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform