IDTSDataPumpTransform::AddVariable

DTS Programming

DTS Programming

IDTSDataPumpTransform::AddVariable

The AddVariable method adds a variable to the execution context of a transformation server. AddVariable is always called one time before ValidateSchema to add the IDTSErrorRecords object.

Syntax

HRESULT AddVariable (
LPBYTE
pvTransformServerData,
LPCOLESTR pwzName,
BOOL bGlobal,
VARIANT Variable );

Argument Description
pvTransformServerData [in] Transform server state data
pwzName [in] Variable name
bGlobal [in] For Microsoft® ActiveX® scripts, indicates whether the methods of this variable must be qualified by the object name
Variable [in] Variable value; passed to and updatable by the transformation server

Remarks

AddVariable allows an application variable to be passed through to the transformation process. The data pump always calls this method to add the DTSErrorRecords object immediately after a call to IDTSDataPumpTransform::Initialize and before a call to ValidateSchema. This allows ValidateSchema to add errors to the OLE DB error records collection for the thread if columns are found to be in error.

For objects to be used in ActiveX scripts, the variable should be ignored if the variant is not of type VT_DISPATCH. This allows all variables to be passed to all transformation servers. The bGlobal parameter indicates whether the properties and methods of the variable are to be added to the global namespace of the script; if so, the method can be called directly, instead of requiring qualification using the object name. Data pump-generated variables (for example, DTSErrorInfo, and the DTSSource and DTSDestination column collections) are always added with this flag set to FALSE to minimize the likelihood of name conflict.