Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding tables to DE
Message
From
16/05/2001 06:30:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
16/05/2001 03:37:38
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00507703
Message ID:
00507722
Views:
10
>Hello.
>
>I want to modify one app, in the following way:
>
>The customer is an firm wich want to work for different companies in the same time. Because the data are huge and almost all the reports and queries are limited to one month, I want to split the database in the following way: (this is the directory structure)
>
>FIRM1
> January
> February
> March, etc
>FIRM2
> January
> February
> March, etc
>FIRM3, etc, in the same way.
>
>I want to do this mainly because the firms have different needs and one firm's database doesn't look like another firm's database.
>
>The main problem I have is the form's dataenvironment. I cannot add any table or view to the dataenvironment, because the form will open automatically the same database. I can manage to find a way to add them programatically, but it seems to be very complicated.
>
>Can anyone help me? I am looking for a short way to add the tables and views to DataEnvironment, assuming I know the database they are contained in, and the name of the view or table.
>
>Or, maybe, there is a 'DataEnvironment Builder'? In the ideal case, I think it has to be a control placed on the form, and the control have to read from a separate table the views and tables names for the loading form and then add them to the form's dataenvironment. At the unload event, it have to close them. Have anyone done such thing?
>
>Thank you,

Grigore,
You have more than one way to do it.
-You might not use a DE at all and load your tables from form.load (probably from a table as you said).
-Like the above but have different DE classes for each different need and assign that one as DE of form.
-Change database and/or cursors in DE on the fly. To do this you do something like :
with thisform.dataenvironment
 .Closetables
* Loop members and change database property - add/remove tables views
 .OpenTables
endwith
-Close dataenvironment tables change data path and open tables.
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