|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
Can anyone shed any light on this? I am running a DTS Import / Export task, and have written this script to do a basic transformation. According to Online books etc it is fine, yet I get an error every time. The error occurs immediately after the last end if, and says that it has failed to load data into the "Stoma" field. Any ideas please? Thanks! '************************************************* ********************* ' Visual Basic Transformation Script ' Copy each source column to the ' destination column '************************************************* *********************** Function Main() DTSDestination("Pharm_Id") = DTSSource("ID") DTSDestination("T_A") = DTSSource("T/A") DTSDestination("PCG") = DTSSource("PCG") DTSDestination("Initials") = DTSSource("Initials") DTSDestination("Name") = DTSSource("Name") DTSDestination("Fax") = DTSSource("Fax") DTSDestination("Tel") = DTSSource("Cascade") DTSDestination("Add1") = DTSSource("Telephone") DTSDestination("Add2") = DTSSource("Address1") DTSDestination("Add3") = DTSSource("Address2") DTSDestination("Add4") = DTSSource("Town") DTSDestination("Pcode") = DTSSource("Borough") DTSDestination("Note") = DTSSource("Note") DTSDestination("Hours1") = DTSSource("Post Code") DTSDestination("Hours2") = DTSSource("FLAG") DTSDestination("Hours3") = DTSSource("Opening Hours1") DTSDestination("Hours4") = DTSSource("Opening Hours2") If DTSSource("Oxygen") = "Yes" then DTSDestination("Oxygen") = "Y" end if If DTSSource("Oxygen") = "No" then DTSDestination("Oxygen") = "N" end if DTSDestination("Stoma") = DTSSource("Stoma") DTSDestination("Elastic") = DTSSource("Elastic") DTSDestination("Trusses") = DTSSource("Trusses") DTSDestination("Res_Advice") = DTSSource("Opening Hours3") DTSDestination("Patient_Rec") = DTSSource("Res Advice") DTSDestination("Other") = DTSSource("Other") Main = DTSTransformStat_OK End Function |
|
#2
|
||||
|
||||
|
Try removing these lines from your script.
Code:
If DTSSource("Oxygen") = "Yes" then
DTSDestination("Oxygen") = "Y"
end if
If DTSSource("Oxygen") = "No" then
DTSDestination("Oxygen") = "N"
end if
If the script works, then you know the above code is causing the problem. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > ActiveX Script in DTS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|