Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Database and private datasessions
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00049960
Message ID:
00050001
Views:
38
>I must be missing something simple here. I have a project that needs to run all private datasessions. No problem there. The problem is how the database gets opened.
>
>I have a method .SetEnvironment() in the form template that is called in the .BeforeOpenTables() method of forms to show. I can open the database via OPEN DATABASE myDB and things are just fine. But I also have a DB class which handles all that stuff and although the form recognizes the object and runs the .OpenDatabase() method, the database is not opened by doing so.
>*
>* This works when MyDB is hardcoded in.
>*
>OPEN DATABASE MyDB
>*
>* This doesn't work although goDB is recognized as an object but none * of the database commands function. Db name is a property within.
>*
>goDB.OpenDatabase()
>
>What am I missing here or am I stuck with hardcoding the database name? I haven't tried instantiating goDB with each form as that seems to be a waste.
>
>Steve
Steve,

goDB is not operating in the same data environment s you form. My approach to this would be to do an AddObject() call to add the oDB class to the form and then call teh classes OpenDatabase() method. Or make the oDB class in code and make it a DataEnvironment class and do teh AddObject to the form in the form's Load.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform