This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Installscript to connect to database using UDL?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 18, 2014
11:20 PM
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!
Thanks!
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jun 19, 2014
12:35 PM
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;