Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unexpected firing of 'On Transform Failure' Phase

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
AU
I have an ActiveX script setup to perfrom certain tasks at the 'Pre Source Data' phase of the Data Pump Task.
I am attempting to fire the function "TransFailureMain" under a certain condition. The trouble is that it fires whether or not that condition is met.
The ActiveX Script code is:

Code:
'**********************************************************************
'  Visual Basic Transformation Script
'************************************************************************

'  Copy each source column to the destination column
Function Main()

	If DTSSource("Individual_Client_Id").value = 10001 then
		msgbox "What error"
		Main = DTSTransformStat_Error 
	else
		Main = DTSTransformStat_OK
	End If

	
End Function

Function PreSourceMain()
	Dim sConn 
	Dim sSQL
	Dim sPath

	set sConn =  CreateObject("ADODB.Connection")
	sConn.Provider = "Microsoft.Jet.OLEDB.4.0"
	sPath = "\\wallsend1 \careimrrpts\KPI_Access_Database\Parameter_Passing_Test.mdb"
	sConn.Open = sPath

	sSQL = "DELETE FROM Hahs_IMRU_GV_Out"	
	sConn.Execute sSQL
	PreSourceMain = DTSTransformStat_OK
End Function

Function PostSourceMain()
	PostSourceMain = DTSTransformstat_OK
End Function

Function TransFailureMain()
	msgbox "Error in Transmain"
	TransFailureMain = DTSTransformstat_OK
End Function

Function InsertSuccessMain()
	InsertSuccessMain = DTSTransformstat_OK
End Function

Function InsertFailureMain()
	InsertFailureMain = DTSTransformstat_OK
End Function

Function BatchCompleteMain()
	BatchCompleteMain = DTSTransformstat_OK
End Function

Function PumpCompleteMain()
	PumpCompleteMain = DTSTransformstat_OK
End Function

As you can see, it is setup to fail if the Client_Id is a certain value. Currently, TransFailureMain() fires whether or not the condition is met.
Thanks



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top