See the below code
The Msboxes do kick up 3709 and the usual error description
Set mcnn = CreateObject("ADODB.Connection")
Set pkg = DTSGlobalVariables.Parent
Set tsk = pkg.Tasks("DTSTask_DTSExecuteSQLTask_11").CustomTask
Set fso = CreateObject("Scripting.FileSystemObject")
Set wsh = CreateObject("WScript.Shell")
Set rstFTP = CreateObject("ADODB.Recordset")
Set rstView = CreateObject("ADODB.Recordset")
' Open ADO connection with the UDL filename
mcnn.Open "File Name=" & DTSGlobalVariables.Parent.Connections("ProductControl").UDLPath
If Err.Number > 0 Or mcnn.Errors.Count > 0 Then
Msgbox "There is a problem connecting to the database"
Msgbox "UDLPath = " & DTSGlobalVariables.Parent.Connections("ProductControl").UDLPath.value
ReportError()
End if
' 1. Loop round the output table
' Loop around tbl_pf_sys_output
rstFTP.Open "tbl_pf_sys_export", mcnn, 3, 1, -1 ' Static cursor, read only lock, unspecified
If Err.Number > 0 Then
Msgbox err.number
Msgbox err.description
Msgbox "There was a problem"
ReportError()
End if
If at first you don't succeed, try for the answer.
The Msboxes do kick up 3709 and the usual error description
Set mcnn = CreateObject("ADODB.Connection")
Set pkg = DTSGlobalVariables.Parent
Set tsk = pkg.Tasks("DTSTask_DTSExecuteSQLTask_11").CustomTask
Set fso = CreateObject("Scripting.FileSystemObject")
Set wsh = CreateObject("WScript.Shell")
Set rstFTP = CreateObject("ADODB.Recordset")
Set rstView = CreateObject("ADODB.Recordset")
' Open ADO connection with the UDL filename
mcnn.Open "File Name=" & DTSGlobalVariables.Parent.Connections("ProductControl").UDLPath
If Err.Number > 0 Or mcnn.Errors.Count > 0 Then
Msgbox "There is a problem connecting to the database"
Msgbox "UDLPath = " & DTSGlobalVariables.Parent.Connections("ProductControl").UDLPath.value
ReportError()
End if
' 1. Loop round the output table
' Loop around tbl_pf_sys_output
rstFTP.Open "tbl_pf_sys_export", mcnn, 3, 1, -1 ' Static cursor, read only lock, unspecified
If Err.Number > 0 Then
Msgbox err.number
Msgbox err.description
Msgbox "There was a problem"
ReportError()
End if
If at first you don't succeed, try for the answer.