dbTalk Databases Forums  

DTS Conversion error because of empty row

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Conversion error because of empty row in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
snaterse@gmail.com
 
Posts: n/a

Default 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.