Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 30th, 2004, 07:40 AM
Paula Paula is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 65 Paula User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 32 sec
Reputation Power: 5
Smile ActiveX Script in DTS

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

Reply With Quote
  #2  
Old September 30th, 2004, 01:27 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > ActiveX Script in DTS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT