Forum Discussion

PUM-Prodat-SQL's avatar
PUM-Prodat-SQL
New Contributor
5 years ago

Database connection

Hey guys,   I like to centralize the database connection string to switch fastly between 2 databases. Does anybody knows how to do this?   I could imagine a solution like creating a string varia...
  • RuanAlesi's avatar
    5 years ago

    You can use a function that returns differents ConnectionString with a CASE/OF.

     

    function YourFunction(WichConnection: string): OLEVariant;

    begin

     case WichConnection of:

        'A': result := ConnectionStringA;

        'B': result := ConnectionStringB;

     end;

    end;