What you need is more than one connection ID.

One connection ID to be used for the shared database and one connection ID that is used for the database of the branch office. Once connected (and I suggest you use DataFlex 19 with managed connections instead of building the 'old' way) you can use RedirectConnection to the right database for the branch.