uniconnection database name

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Senad
Posts: 34
Joined: Tue 10 Dec 2013 08:07

uniconnection database name

Post by Senad » Wed 12 Aug 2015 09:49

When establishing a connection to sql server using uniconnectdialog,
does uniconnection know that from now on the database name is the one
supplied in the uniconnect dialog ?
Or must I do ? :

Code: Select all

UniConnection1.Database :=UniConnectDialog1.Connection.Database;
I am asking this because I will be using many tables and I want to know
if I must specify database name for every table or the tables already know
they should use uniconnections database name.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: uniconnection database name

Post by AlexP » Wed 12 Aug 2015 11:47

hello,

Yes, the name will be set in the UniConnection.Database property:

Code: Select all

  if UniConnectDialog1.Execute then
    ShowMessage(UniConnection1.Database);

Senad
Posts: 34
Joined: Tue 10 Dec 2013 08:07

Re: uniconnection database name

Post by Senad » Thu 13 Aug 2015 10:16

Tables do follow ?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: uniconnection database name

Post by AlexP » Fri 14 Aug 2015 07:55

If you don't specify the database name in the query explicitly, then the name set in ConnectDialog will be used. If you want to use tables from other databases, you should specify the DB name explicitly in queries.

Post Reply