Hi,
I need to do this:
ADOQuery1.SQL.Text :=
'SELECT a.id, a.Name ' +
'FROM ' + base_1 + '..table_1 a ' +
'WHERE (a.Ina = 0) ' +
'AND ' +
'a.id NOT IN (SELECT b.id ' +
'FROM ' + base_2 + '..table_1 b ' +
'WHERE b.id = b.id)';
The problem is that the Connection Strings are in UDL files:
In file_1.udl
(contain the name of the database 1 -> base_1)
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=name_of_base_1;Data Source=data_source
In file_2.udl
(Contain the name of the database 2 -> base_2)
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=name_of_base_2;Data Source=data_source
How can I read from the UDL file or from the TADOCOnnection's that use the UDL files, the value of the "Initial Catalog" in the connection strings and put these values on the base_1 and base_2 string variables?
There's an EASY way?
Thanks!
I need to do this:
ADOQuery1.SQL.Text :=
'SELECT a.id, a.Name ' +
'FROM ' + base_1 + '..table_1 a ' +
'WHERE (a.Ina = 0) ' +
'AND ' +
'a.id NOT IN (SELECT b.id ' +
'FROM ' + base_2 + '..table_1 b ' +
'WHERE b.id = b.id)';
The problem is that the Connection Strings are in UDL files:
In file_1.udl
(contain the name of the database 1 -> base_1)
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=name_of_base_1;Data Source=data_source
In file_2.udl
(Contain the name of the database 2 -> base_2)
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=name_of_base_2;Data Source=data_source
How can I read from the UDL file or from the TADOCOnnection's that use the UDL files, the value of the "Initial Catalog" in the connection strings and put these values on the base_1 and base_2 string variables?
There's an EASY way?
Thanks!