all groups > sql server dts > december 2003 >
You're in the

sql server dts

group:

Executing a DTS from VB6 ( SP5 )


Executing a DTS from VB6 ( SP5 ) Peter Newman
12/19/2003 12:58:53 AM
sql server dts:
I have a DTS that updates 2 tables from a VB6 application
or from text files stored on the server . I am executing
the DTS from a Visual Basic project using the code below

Dim oPkg As New DTS.Package

oPkg.LoadFromSQLServer ServerName:="ServerName",
ServerUserName:="UserName",
ServerPassword:="ServerPassword", PackageName:="DTS
Package Name"

oPkg.GlobalVariables.Item(1).Value = "Value"

oPkg.Execute

This is working fine, however the DTS package also runs
as a Scheduled Task to import txt files uploaded by our
clients. How can i dectect if the DTS is already
running, or can i have two instances of the DTS running
Re: Executing a DTS from VB6 ( SP5 ) Allan Mitchell
12/19/2003 9:16:23 AM
The typical way to tell if a package is running is to have a Status table
that is updated when the package starts and finishes. This way you can check
and find out what the package is going.

Yes the same package can be run concurrently

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



[quoted text, click to view]

Executing a DTS from VB6 ( SP5 ) mike
12/19/2003 9:57:45 AM
Hi Peter, I'm actually trying to import excel files via
DTS and was wondering whether the text files you import
have the same structure all the time or do you create the
DTS packages dynamically with COM, if you do can you show
me how you do it, I'm having a lot of problems creating
DTS packages with COM since my file structure changes all
the time. I'm not even sure whether I should create these
packages since I will probably not be able to reuse them,
really not sure what I should do. Any help would be great
and appreciated. Thanks a lot!

[quoted text, click to view]
Executing a DTS from VB6 ( SP5 ) Peter Newman
12/23/2003 11:51:58 AM
Mike,

Sorry for the long delay..

Part of my DTS is importing Text Files into 2 tables.
Although the files are in the same format all the time, i
am using activex components to dynamically set the
execute SQL tasks for the import. you should be able to
use active x tasks to set up 'ExecuteSQlTasks', or
DataPump tasks. this should give you the dynamic angle to
cope with the different file structures
Hope that helps
Pete

[quoted text, click to view]
AddThis Social Bookmark Button