dbTalk Databases Forums  

Executing a DTS from VB6 ( SP5 )

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


Discuss Executing a DTS from VB6 ( SP5 ) in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter Newman
 
Posts: n/a

Default Executing a DTS from VB6 ( SP5 ) - 12-19-2003 , 02:58 AM






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
with both using different values for the Global varaibles?

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Executing a DTS from VB6 ( SP5 ) - 12-19-2003 , 03:16 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



"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
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
with both using different values for the Global varaibles?



Reply With Quote
  #3  
Old   
mike
 
Posts: n/a

Default Executing a DTS from VB6 ( SP5 ) - 12-19-2003 , 11:57 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!

Quote:
-----Original Message-----
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
with both using different values for the Global varaibles?
.


Reply With Quote
  #4  
Old   
Peter Newman
 
Posts: n/a

Default Executing a DTS from VB6 ( SP5 ) - 12-23-2003 , 01:51 PM



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

Quote:
-----Original Message-----
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!

-----Original Message-----
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
with both using different values for the Global
varaibles?
.

.


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.