Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling multiple databases
Message
From
26/05/1998 10:52:22
 
 
To
26/05/1998 10:46:20
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00101911
Message ID:
00101912
Views:
12
>I'm relatively new to VFP 5.0 - I'm developing an application where I'll be using multiple databases (all related tables in them will be identical in terms of structure). I want to use the same forms for all the databases, and simply be able to switch between them as needed. My question is: it seems that the data environment is best suited for a single database. Am I better off not using the data environment for my forms creation, and 'manually' opening the databases using SET RELATION commands? Or, is there something I'm missing in the data environment/form designer?
>
>The general question: how does one best handle multiple databases using common forms? Is the data environment useful in this case or not?
>
>Thanks for any suggestions....

DataEnvironment is fine and should be used. The generic way to handle multiple database with the same content is to reset programmatically Database properties for all cursors in DE and VFP will take care of the rest.
*** DE.BeforeOpenTables event
cDbcpathname=oApp.dbcpathname && some configuration setting
Thisform.DataEnvironment.SetAll("Database",cDbcpathname,"Cursor")
This will work fine for all dbc-ed tables. If you use free tables your code should take care of CursorSource properties.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform