Hi;
I wanted to use the following code to run a DTS package from a 2005 Web Page code behind partial class. This code works fine in a VB 2003 module
going against SQl Srvr 2000.
Here is the code: (It initiates from a button click handler)
Dim conn As New SqlConnection("initial catalog=MY_Data;server= XYZ081552X7X441\TRSQL;integrated security=SSPI") Dim hold1 As Integer Dim hold_source As String = "" Dim hold_desc As String = "" Tryconn.Open()
Catch ex1 As ExceptionMsgBox(
"The Test connection failed to open" & vbCrLf & ex1.Message) End TryMsgBox(
"About to create a DTS object") Dim oPackage As New DTS.Package2Class (Compiler doesn't like this line) Type DTS.Package2Class is not defined.
Dim oStep As DTS.Step (Or this one) Type DTS.step is not defined.
oPackage.LoadFromSQLServer("XYZ81552X7X441\TRSQL", , , DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, , , , "cpyPrinters2Excel", )
For Each oStep In oPackage.StepsoStep.ExecuteInMainThread =
True NextoPackage.Execute()
For Each oStep In oPackage.Steps If oStep.ExecutionResult = DTS.DTSStepExecResult.DTSStepExecResult_Failure ThenoStep.GetExecutionErrorInfo(hold1, , )
Else End If NextoPackage.UnInitialize()
oPackage =
Nothingconn.Close()
Has Microsoft changed the DTS objects so that they work only with SQL Srv 2005
Thanks for your insights.