Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-company system
Message
From
08/03/2019 01:03:57
 
 
To
07/03/2019 09:16:18
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01667024
Message ID:
01667105
Views:
89
>Why have multiple databases? If you have multiple databases, then you have to manage the changing between them based on Company. I would add a field (companyid) to each table record key for the tables that are shared between the companies; i.e., the record key is now comprised of multiple fields (id and companyid). This key field will separate the records by company. Tables that are shared across companies; i.e., lookup tables, do not have the company key (unless each company can have a different configured list of values). Then create a custom property on _VFP as follows:
>
>
>ADDPROPERTY(_VFP, "CompanyId", "")
>
>
>Now set this property value for the current company. Then use this property value in the SELECT statements to retrieve the records that are applicable to the current selected company. This same functionality is used in SAP R/3 and S/4HANA to separate between client systems and has worked very well for decades.

There are pros and cons to both solutions:

Seperate database make is easy to backup single companies and even import/export single companies. That is possible with a Company ID as well, but with much overhead and much slower. Database access could be managed on db level to have a higher level of security.

Using separate database would mean that the client needs to have CreateDB rights on the server, which many admins don't want to give anymore.

I guess you could come up with a list and compare the specific situation to see where you are willing to do trade offs.
Christian Isberner
Software Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform