DTS Conversion error because of empty row -
12-20-2006
, 03:43 AM
Hi,
I have a DTS package which transforms data (ActiveX) from a .CSV
(Datasource = text file) file to the database. But when the last row in
the CSV is empty it will give a conversion error:
Type mismatch: 'CDbl'.
When I remove the last (empty) row, the error is gone and there's no
problem. But the other problem is that I cannot change the CSV's, so
remove the last empty row is not an option.
So i build the script to check on empty cells, so this error has to be
skipped. but it doens't.
Does anybody have suggestions?
The ActiveX script:
Function Main()
if IsNull(DTSSource(1)) = false then
DTSDestination(1) = CDbl(DTSSource(1))
end if
Main = DTSTransformStat_OK
End Function
I also tried this script, but it doesn't work either:
Function Main()
if IsNull(DTSSource(1)) then
DTSTransformStat_ErrorSkipRow
Else
DTSDestination(1) = CDbl(DTSSource(1))
end if
Main = DTSTransformStat_OK
End Function |