I have a simple bit of code that uses a Glabal variable
and a Lookup to get a maximum value for a field from the
table and increment the field as records are run through
the process. I set a default value of 0 for the first
record of each run so the first record executes the
lookup. I get an error when I test it that doesn't make
sense to me.
The error is "Variable uses an Automation type not
supported in VBScript". The line number it gives is the IF
statement below. Any ideas?
Here is the code:
if DTSGlobalVariables("MaxRequestNo").Value = 0 then
sMaxRequestNo = DTSLookups("MaxRequestNo").Execute(0) + 1
else
sMaxRequestNo = DTSGlobalVariables("MaxRequestNo").Value
+ 1
end if