Hi Sukhendu,
this is a good conversation because there are many solutions to the problem. Ultimately you need to pick the one that suits you best.
you really have 2 questions to answer here -
i) how does the user identify which company data they want
ii) what configuration will you use for hosting.
The two questions are distinct - so let's do the first one first.
a) you may have 1 domain (let's call it sukhendu.com) but that domain can have many subdomains. Adding subdomains is as easy as adding a dns record - which is very easy to do. In this situation company A becomes a.sukendu.com, company b uses b.sukhendu.com and you can still use
www.sukhendu.com for your normal web site. Your program sets the data set to use (for that one request) based on which url they are using.
b) when logging in the user selects a company from a list (which you can "remember" in a cookie for them). You set a session value based on this choice, and the server uses this to pick the appropriate data files for each request.
c) Both companies share a common user list. When a user logs in you "know" which company they belong to based on values set in the user table. This is then stored in a session value, and the correct set of data files is set for each request
d) each company connects on a different port. Which in turn means multiple instances of the exe are running, and each exe is set to use a specific data set. This is the only option that requires multiple instances of the exe.
Now to the second question.
Since the program is the same for both companies - only the data varies - you don't need multi-host at all. You can run on server which serves both sets of users. Or you can run multiple instances of the server on different ports - that's your choice.
With regard to "how to set the correct data set" - I usually
i) create a function - call it say "setPathNames".
ii) call this function from the web handler - ProcessLink method, before parent call. Pass enough information to identify the data set required. (typically from a session value)
iii) in the function set the "full path name" for each table (if using TPS) or set the glo:owner variable (for SQL). Which ever variables you set, those variables must be THREADed.
cheers
Bruce