Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read the "Initial Catalog" parameter from conn string in UDL file

Status
Not open for further replies.

jauch

Programmer
Feb 9, 2008
2
PT
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!
 
why use udl files anyway?

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top