How to clone UniConnection?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sbokharis
Posts: 1
Joined: Sun 26 Mar 2017 12:00

How to clone UniConnection?

Post by sbokharis » Sun 26 Mar 2017 12:03

Hi,

We are developing a large system using UniDAC and MySQL. We have a main UniConnection in a data module. We set all properties at design time and some at run-time.

Read-only and system specific queries are handled in main connection. In all other forms, we make a clone of main UniConnection which is totally independent. Handle its inserts, updates, deletes and transactions separately on each form.
Currently, we do individual property assignment of non-default properties of main UniConnection in cloned connection. We know this is not an elegant way.

We have used AssignConnect method but it shares the same handle as mentioned in the documentation.

My question is this, what is the best way to clone a UniConnection?

Using Delphi 10.1 Update2, UniDAC 6.4.16 Pro

Regards

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: How to clone UniConnection?

Post by ViktorV » Wed 29 Mar 2017 15:02

To solve the issue, you can assign the TUniConnection.ConnectString property to the new connection.

Post Reply