Check date in DTS -
08-23-2005
, 06:16 AM
Hi all,
I am trying to import data (about 18,000 rows) from Access 97 to SQL
Server 2000 via DTS. Some of the date are invalid such as 15/6/989 or
21/07/3005 (I can't make any changing in source table). I have written
the below Active X scripts for fitering but there is always have a error
when importing (data over flow):
If IsDate(DTSSource("Project Closed")) then
DTSDestination("Project ID") = DTSSource("Project ID")
DTSDestination("Project Name") = DTSSource("Project Name")
DTSDestination("Project Closed") = DTSSource("Project Closed")
Main = DTSTransact_OK
Elseif Not(IsNull(DTSSource("Project Closed"))) and
Not(IsDate(DTSSource("Project Closed"))) then
DTSDestination("Project ID") = DTSSource("Project ID")
DTSDestination("Project Name") = DTSSource("Project Name")
DTSDestination("Invalid Date") = CStr(DTSSource("Project Closed"))
'would like to convert to string to store the invalid date to the
another column
Main = DTSTransact_OK
Else
Main = DTSTransact_SkipInsert
End if
Can anyone help about this problem. Thanks a lot. |