Hi all, Iâm really sorry to trouble you with such a trivial request. Iâve been doing programming on and off for 5 years or so, but not much exposure to
VB.
Iâm trying to implement a
VB ActiveX routine in DTS SQL Server 2000. What Iâd like to do, which Iâm having problems with, is create a function that takes two string arguments, does some processing, and returns a string.
Iâve created an example in
VB .Net which works, but I canât get it to work on SQL Server 2000 DTS. I guess it is something to do with a change between the two versions of the languages. However, I havenât been able to find one example of a function (plenty of subs but no functions).
Anyway, the failing code is below:
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
Dim Resp as String
Set Resp = Hello (âParam1â,âParam2â)
Main = DTSTaskExecResult_Success
End Function
Function Hello (ByVal MyVar1 as String, ByVal MyVar2 as String ) as String
Hello= "Hello"
End Function
I get an error on line 10 (the line starting Function Hello (ByValâ¦
Has anyone got any ideas what Iâm doing wrong (apart from program in a language I clearly know nothing about!)?
I genuinely appreciate any feedback.
Many thanks.
Well if a reboot doesn't fix it, I don't know what will!