This sample demonstrates how you can use the DTS GlobalVariables collection to invoke ADO objects, methods, and properties from within a DTS Microsoft® ActiveX® script.
Function Main()
DTSGlobalVariables("adoConnection").Value =
CreateObject("ADODB.Recordset")
DTSGlobalVariables("adoConnection").Value.Open "select * from
authors", _
"DRIVER={SQL Server};Server=.;UID=sa;PWD=;Database=pubs"
MsgBox DTSGlobalVariables("adoConnection").Value.Fields.Count
DTSGlobalVariables("adoConnection").Value = nothing
Main = DTSTaskExecResult_Success
End Function