cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peakbagger66
Level 4

Installscript to connect to database using UDL?

Just wondering if there is a built in function to connect to a database using a pre-existing UDL file in installscript. Is it possible to do this, or do we need to parse the UDL file?

Thanks!
Labels (1)
0 Kudos
(1) Reply
hidenori
Level 17

There is no built-in InstallScript functions to manage .udl files. But you should be able to connect to a database using ADO as follows:

set conn = CoCreateObject("ADODB.Connection"); 

conn.ConnectionString = "File Name=C:\\MyTest.udl;";
conn.Open;

if conn.State = 1 then
//connected
MessageBox("Connected to the database", INFORMATION);
conn.Close;
else
MessageBox("Connection failed.", SEVERE);
endif;

conn = NOTHING;
0 Kudos