Page 1 of 1

How to find an existing connection? (Migration Question)

Posted: Tue 16 Jun 2009 11:19
by invent
Hi,

I bought the UniDac-Components last month and they are very good. Thank you for your excellent work!

Now I want to migrate my Delphi7-projects and I have a problem and I need your help. I made some library-units with database-functions. The Problems is, that I use these units in different programs and I don't know the Database-Connection.

Example: With the BDE I have this solution:

function GetCustomerName : string;
var MyQuery : TQuery;
begin
MyQuery := TQuery.Create (nil);
MyQuery.Databasename := Session.Databases[0].Databasename;
MyQuery.Sessionname := Session.Databases[0].Sessionname;
MyQuery.Sql.Add('SELECT name FROM customers ... '):
...
end;

I have no idea how to realize such functions with UniDac.

Thanks in advance for any help.

Greetings from Germany
Gerd Brinkmann
invent GmbH

Posted: Wed 17 Jun 2009 09:12
by Plash
You can pass a reference to the TUniConnection component as a parameter to these functions.

Posted: Wed 17 Jun 2009 09:24
by invent
Thanks for your answer. A Parameter is not a really good idea. I have to change thousands of lines.

Okay, so I have to find another solution...

Kind regards,
Gerd Brinkmann
invent GmbH