In an existing DA application that handles data acquisition from industrial machinery, my customer has decided to separate the database based on the year of the data. Thus, while the database structure remains the same, I will no longer have a single database but rather n instances of the same database, each containing data for a specific year. There will be a “live” database, which I call Database
, and all others will be named Database2020
, Database2021
, Database2022
, Database2023
, and Database2024
. Since I would prefer not to make significant changes to the logic, my idea is to retrieve the date parameters of the dataset the user is requesting (datasets opened by the client in this logic must always specify a date range) and dynamically switch the connection to fetch the data from the correct database based on the requested year. All the data is read-only, as it consists of historical data. Is something like this feasible?
Hi,
Yes, this is feasible.
Note: I assume that you are using Delphi and standard RDA calls on client-side.
You can override GetData method. here you can extract required data for detecting year. Don’t forget to call Result := inherited GetData(...);
after detecting year.
in OnBeforeAcquireConnection event you can specify required connection name.
1 Like
Hi EvgenyK
sorry! Yes, I use Delphi and standard RDA calls
Thank you very much for your support…I try!!!