To work around this problem, substitute scriptor functoids for the BizTalk Database Lookup and Value Extractor functoids. To do this, perform the following steps:
Create a scriptor functoid that provides the functionality of the Database Lookup functoid
- Copy the script code used in the Database Lookup functoid into a scriptor functoid.
- Comment out the following line of code in the scriptor:
Set ArrRecordSet(Index).ActiveConnection = Nothing
- Remove the square brackets contained in the following ADO SELECT statement that is contained in the scriptor code:
strQuery = "SELECT * FROM [" + CStr(Table) + "] WHERE " + CStr(Column) + " = " + "'" + CStr(Value) + "'"
- The Database Lookup functoid requires four input parameters; however, the FctDBLookup function used by the Database Lookup script requires a fifth Index parameter that is supplied by the BizTalk Messaging engine when the Database Lookup functoid is called.
To create a scriptor functoid that provides the same functionality that the Database Lookup functoid provides, you must manually provide the Index input parameter, because the BizTalk Messaging engine does not provide the index value to a generic scriptor functoid.
After you copy the script code that is used in the Database Lookup functoid into the scriptor functoid, insert these five input parameters in the following order:
- The index value
- The lookup value
- The database connection string
- The table name
- The column name for the lookup value
Although you can set the index value to any positive integer value, this index value should be set to 0 for optimal performance.
After you complete the previous steps, you will have a working copy of a scriptor that provides the same functionality as the Database Lookup scriptor. You must then create additional scriptors to mimic the functionality of the Value Extractor functoid, because the Value extractor functoid only accepts input from the Database Lookup functoid and will not accept input from a scriptor functoid.
Create scriptor functoids that provide the functionality of the Value Extractor functoid
- Copy the script code used in the Value Extractor functoid into a scriptor functoid.
- If more than one Value Extractor functoid is needed, copy the script code that is used in the Value Extractor functoid into additional scriptor functoids. If more than one scriptor functoid is used in place of the Value Extractor functoid, you must change the name of the FctDBValueExtract function in subsequent scriptor functoids, otherwise you will not be able to save the functoid into the map, and the following error message will be displayed when you attempt to save the scriptor:
The function name "fctdbvalueextract" is already in use. Rename the function to another name.
- Insert these two input parameters into the scriptor in the following order:
- A link to the Scriptor functoid that you created in step 1
- The column name for the field from which you want to extract data
After you complete these steps, you will have a working copy of a scriptor that provides the same functionality as the Value Extractor functoid.