dbTalk Databases Forums  

Need help with ActiveX Script!!!

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


Discuss Need help with ActiveX Script!!! in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
B.
 
Posts: n/a

Default Need help with ActiveX Script!!! - 07-26-2006 , 02:16 AM






am totally new to VB and i have just started to learn it. I am stuck
at the very basics so i would really appreciate any help.
What i need to do is transfer the information from an Excel file to a
SQL server table via a DTS package by copying columns. During the
transfer i need to perform some data transformation. One of these
consists in creating an ActiveX Script to check one of the Excel file
columns which contains strings in the form LI,LO and trim the L to
transfer just the I's and O's in one of the table columns. The code i
have so far is:

' Copy each source column to the destination column
Function Main()


Dim MyString


If InStr (MyString, "L") <> 0 Then


Right$(MyString,1)
End If
DTSDestination("PTYPE") = DTSSource("Col004")
Main = DTSTransformStat_OK
End Function


However it is prompting for an error.Does anyone have any idea
why?Thank you very much for your time!


Reply With Quote
  #2  
Old   
Davide
 
Posts: n/a

Default Re: Need help with ActiveX Script!!! - 07-26-2006 , 02:28 AM






Hello B.,

Quote:
am totally new to VB and i have just started to learn it. I am stuck
at the very basics so i would really appreciate any help.
What i need to do is transfer the information from an Excel file to a
SQL server table via a DTS package by copying columns. During the
transfer i need to perform some data transformation. One of these
consists in creating an ActiveX Script to check one of the Excel file
columns which contains strings in the form LI,LO and trim the L to
transfer just the I's and O's in one of the table columns. The code i
have so far is:
' Copy each source column to the destination column Function Main()

Dim MyString

If InStr (MyString, "L") <> 0 Then

Right$(MyString,1)
End If
DTSDestination("PTYPE") = DTSSource("Col004")
Main = DTSTransformStat_OK
End Function
However it is prompting for an error.Does anyone have any idea
why?Thank you very much for your time!

this is VB script use function 'Right' not 'Right$'

Bye




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.