Link to home
Start Free TrialLog in
Avatar of mcrmg
mcrmg

asked on

ActivexX InputBox

Hi,

In ActiveX, is there a way to take imput from user and then do some validation.  User can click on eithere OK or CANCEL to proceed or quit DTS?  Thx
Avatar of patrikt
patrikt
Flag of Czechia image

Who do you suppose is user? DTS package is running on server in server service context. It has no user interface and no user to ask.

Patrik
Avatar of mcrmg
mcrmg

ASKER

lol............

You are right........ I meant the person who use this DTS.... (in this case, it would be me........)

Sorry for the confusion...
Avatar of Anthony Perkins
Add an ActiveX script and use something like this:

Function Main()
Dim Value
Dim IsValid

Value = InputBox("Enter value here", "")
'  Do validation here and set the IsValid variable appropriately

If IsValid Then
      Main = DTSTaskExecResult_Success
Else
      Main = DTSTaskExecResult_Failure
End If

End Function

Then set your Workflow to only proceed if the previous task is successful.

And finally, don't even attempt to schedule this DTS package :)
Avatar of mcrmg

ASKER

This is what I try to do, something like this:

When I enter a value, say, 9

it will take that 9 and show in msgbox, say, September

If I click on OK, DTS will proceed, if I clcik on CANCEL, DTS will quit. possible?  Thx

ASKER CERTIFIED SOLUTION
Avatar of patrikt
patrikt
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mcrmg

ASKER

Hi,

I was trying the code, then for some reason that I can not find the panel that I can put in the code.  When double click on Activex in dts, it pops up ActiveX Script Task Properties, How can I open the panel that I can write the code?  Thx
Avatar of mcrmg

ASKER

usually, there is "language" on left hand side, and a panel for coding on right hand side, the one on right hand side disappeared.......
>>When double click on Activex in dts, it pops up ActiveX Script Task Properties, How can I open the panel that I can write the code?<<
No idea what could be happening.  I just created a new package and single clicked on the ActiveX Script Task icon on the left and the new window opened to enter the code.
Avatar of mcrmg

ASKER

very strange, if I work on the server directly, it is fine.  But if I open it on client, I do not have edit area.......
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial