Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call function in another script

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
Is it possible to call a function in another ActiveX script from a different ActiveX script in the same DTS package?

Meaning I could have 1 script with global functions that I can call from other scripts in the same package.
 
I don't think so. Even if you could find a way, I'm sure it'd be more trouble than its' worth. Why not just copy/paste your function into the new script task?

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Yup, thanks. It did help. Being a VB guy, I'm used to reusing code, but have found another way.
Thanks again.
 
What was the other way that you found?

Ignorance of certain subjects is a great part of wisdom
 
What I wanted was to tie in all of the Failures into this ActiveX script that could figure out what went wrong then emil me with one email, and write it to a sql table.

There's no good way to use sql server as a log, huh?
I don't mean the sql log files, I mean a self made table that I can pump all of the errors and runtime info into.

I see that I can create a log on the drive to show me the running information, but can't seem to get it into a table in real time.

~G
 
Also tried it with a lot of global variables.
 
What kind of package are you working on here? I think you want to create a table, and have your inserts done as your steps succeed/fail. Then you should be able to query this table to find what you are looking for. Maybe I am misunderstanding your goal though.

Good Luck,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Alex , you are understanding me correctly.

My dts is a simple import from a flat file, generated from a main frame.
It's comma delimited but what if it does not work all the time?
What if the import file is not there? After the import I rename the file using the ActiveX script and file system objects to append a time and date.
What if that fails?

What I'm looking to do at the end is create a web page that I can pull up that has all of the import steps in it (and other information) so I can see what step failed without having to log into sql server.
I figured I could drive this web page with a sql server table. :)

Thanks for the help, by the way.

 
Have a look at the workflow properties, you can have your package continue on different steps based on success/failure. So something like on failure, go to (step to insert your record into table and terminate package), but on success, continue on. You just need to make sure that you disable/enable steps to make sure that your package finishes correctly.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Alex, will this work if it's all in one package?
 
Yes, you need to define work flow within the package. I am sure you've used the 'on success'. I wish I could post a screenshot, because that would make things much easier to explain!

Basically you will have your workflow branch at key points, where it will either a. Continue on or b. Log the error and terminate the package. Are we still on the same page with what you're trying to do?

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
YES! You're right on.

Let me see if I can describe it to you.
This thing is so simple it's not funny.

I have a dynamic properties task that takes the name of the file and folders from a configuration table in the database.

On Sucess, it then moves to an ActiveX script that reads the global variables and copies the file from the bridge, (server folder) to a local import folder, then checks the local folder to make sure the file exists.

On failure it connects to a Send mail Task.

On Success it moves to an Excute SQL Task that truncates the import table.
On Sucess that moves to the FlatFile connection that has a Transform Data Task that connects to the SQL Server database connection.
On **Complete** it moves to the ActiveX that renames the file, appending the time and date.
On failure of this ActiveX, it's connected to a SendMail Task.

The reason for the **Complete** and not a Success is that even if the import process did not work, I still want the file archived so it does not get overwritten.

Hope that helps.

If any of the SQl tasks go bad then I'll never know, and if one thing gos bad I'll get 2 or more emails which is not what I want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top