Page 1 of 1

uniconnection database name

Posted: Wed 12 Aug 2015 09:49
by Senad
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.

Re: uniconnection database name

Posted: Wed 12 Aug 2015 11:47
by AlexP
hello,

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

Code: Select all

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

Re: uniconnection database name

Posted: Thu 13 Aug 2015 10:16
by Senad
Tables do follow ?

Re: uniconnection database name

Posted: Fri 14 Aug 2015 07:55
by AlexP
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.