Groups | Blog | Home
all groups > sql server dts > july 2007 >

sql server dts : Connection From ActiveX Script Task to local server


Geri Reshef
7/26/2007 12:00:00 AM
I'm Using a VB Script (ActiveX Script Task) to create a connection and a =
recordset to a specific database in the local server.
I dont want to name the server explicitly in the connection string =
because the DTS package would be installed in another server with =
another name.
How could I reffer to the server (and instance) in which the DTS package =
Geri Reshef
7/26/2007 4:55:42 PM
Function Main()
Dim Cn, RS, F

Set Cn =3D CreateObject("SQLDmo.SqlServer")=20
Cn.LoginSecure =3D True=20
Cn.Connect "(local)"=20
Set RS=3DCn.Databases("LTSB").ExecuteWithResults("Select ... From ... =
Where ...")
F =3D RS.GetColumnString (1,1)
..
..
..
Main =3D DTSTaskExecResult_Success
AddThis Social Bookmark Button