dbTalk Databases Forums  

Problem Executing DTS Task from VB

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


Discuss Problem Executing DTS Task from VB in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Fox
 
Posts: n/a

Default Problem Executing DTS Task from VB - 05-18-2005 , 01:51 PM






Hi,

Running DTS from VB is new to me, so apologies for the newbie question. I
have a DTS package which runs problem free in MMC. I wanted to automate the
execution using VB6. I've loaded the a Package2 object using the
LoadFromSQLServer method (which works fine), but the Execute method fails as
follows:

Error: x80040005
EXCEPTION_ACCESS_VIOLATION

The package basically recreates tables in SQLServer, and copies in data from
Access to these tables.

I'm out of ideas...
Any help is much appreciated!

Thanks,
Jim
jimf (AT) imxinc (DOT) com



Reply With Quote
  #2  
Old   
Jim Fox
 
Posts: n/a

Default Re: Problem Executing DTS Task from VB - 05-18-2005 , 02:05 PM






Forgot to mention - I'm using SQLServer 2000.


"Jim Fox" <jimf (AT) imxinc (DOT) com> wrote

Quote:
Hi,

Running DTS from VB is new to me, so apologies for the newbie question. I
have a DTS package which runs problem free in MMC. I wanted to automate
the
execution using VB6. I've loaded the a Package2 object using the
LoadFromSQLServer method (which works fine), but the Execute method fails
as
follows:

Error: x80040005
EXCEPTION_ACCESS_VIOLATION

The package basically recreates tables in SQLServer, and copies in data
from
Access to these tables.

I'm out of ideas...
Any help is much appreciated!

Thanks,
Jim
jimf (AT) imxinc (DOT) com





Reply With Quote
  #3  
Old   
Darren Green
 
Posts: n/a

Default Re: Problem Executing DTS Task from VB - 05-18-2005 , 02:55 PM



Quote:
Running DTS from VB is new to me, so apologies for the newbie question. I
have a DTS package which runs problem free in MMC. I wanted to automate
the
execution using VB6. I've loaded the a Package2 object using the
LoadFromSQLServer method (which works fine), but the Execute method fails
as
follows:

Error: x80040005
EXCEPTION_ACCESS_VIOLATION


Set the ExecuteInMainThread property to true.

Execute a package from Visual Basic (VB)
(http://www.sqldts.com/default.aspx?208)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #4  
Old   
Jim Fox
 
Posts: n/a

Default Re: Problem Executing DTS Task from VB - 05-18-2005 , 03:28 PM



Thanks for the help. Unfortunately, this did not do the trick... However,
after exploring the articles in the link you provided, I foud a solution.
Apparently, declaring a Package using the WITHEVENTS keyword is the issue...
Once I removed WITHEVENTS everything worked fine.

Many thanks!

Jim

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
Running DTS from VB is new to me, so apologies for the newbie question.
I
have a DTS package which runs problem free in MMC. I wanted to
automate
the
execution using VB6. I've loaded the a Package2 object using the
LoadFromSQLServer method (which works fine), but the Execute method
fails
as
follows:

Error: x80040005
EXCEPTION_ACCESS_VIOLATION



Set the ExecuteInMainThread property to true.

Execute a package from Visual Basic (VB)
(http://www.sqldts.com/default.aspx?208)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




Reply With Quote
  #5  
Old   
Darren Green
 
Posts: n/a

Default Re: Problem Executing DTS Task from VB - 05-18-2005 , 04:00 PM



There is nothing wrong with using WithEvents, but you need to implement
all event handlers. Events generally give you more information about
errors that some of the other mechanisms as well. Sample code there on
the site.

Darren

In message <ueHV4g#WFHA.3584 (AT) TK2MSFTNGP14 (DOT) phx.gbl>, Jim Fox
<jimf (AT) imxinc (DOT) com> writes
Quote:
Thanks for the help. Unfortunately, this did not do the trick... However,
after exploring the articles in the link you provided, I foud a solution.
Apparently, declaring a Package using the WITHEVENTS keyword is the issue...
Once I removed WITHEVENTS everything worked fine.

Many thanks!

Jim

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message
news:fJZy48J225iCFwxF (AT) sqldts (DOT) com...
Running DTS from VB is new to me, so apologies for the newbie question.
I
have a DTS package which runs problem free in MMC. I wanted to
automate
the
execution using VB6. I've loaded the a Package2 object using the
LoadFromSQLServer method (which works fine), but the Execute method
fails
as
follows:

Error: x80040005
EXCEPTION_ACCESS_VIOLATION



Set the ExecuteInMainThread property to true.

Execute a package from Visual Basic (VB)
(http://www.sqldts.com/default.aspx?208)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #6  
Old   
Jim Fox
 
Posts: n/a

Default Re: Problem Executing DTS Task from VB - 05-18-2005 , 04:52 PM



AH-HAH!!! OK thanks - I was originally going to use the events b/c I
thought the Execute method would run asynch. But it actually runs in synch,
so I'm good.
Thanks again - I much appreciate the direction.



"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
There is nothing wrong with using WithEvents, but you need to implement
all event handlers. Events generally give you more information about
errors that some of the other mechanisms as well. Sample code there on
the site.

Darren

In message <ueHV4g#WFHA.3584 (AT) TK2MSFTNGP14 (DOT) phx.gbl>, Jim Fox
jimf (AT) imxinc (DOT) com> writes
Thanks for the help. Unfortunately, this did not do the trick... However,
after exploring the articles in the link you provided, I foud a solution.
Apparently, declaring a Package using the WITHEVENTS keyword is the
issue...
Once I removed WITHEVENTS everything worked fine.

Many thanks!

Jim

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:fJZy48J225iCFwxF (AT) sqldts (DOT) com...
Running DTS from VB is new to me, so apologies for the newbie
question.
I
have a DTS package which runs problem free in MMC. I wanted to
automate
the
execution using VB6. I've loaded the a Package2 object using the
LoadFromSQLServer method (which works fine), but the Execute method
fails
as
follows:

Error: x80040005
EXCEPTION_ACCESS_VIOLATION



Set the ExecuteInMainThread property to true.

Execute a package from Visual Basic (VB)
(http://www.sqldts.com/default.aspx?208)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




Reply With Quote
  #7  
Old   
Jim Fox
 
Posts: n/a

Default Re: Problem Executing DTS Task from VB - 05-18-2005 , 05:01 PM



By the way... just wondering.... is there a simpler way to initiate
execution of a DTS package? I can see why the VB DTS library is so
useful... mainly for modifying / customizing DTS packages at runtime.
However, if I'm just interested in executing an existing package without
modifications, it seems that loading the package into a VB class and
executing is excessive... perhaps there's a command object (maybe in
SQL-DMO) that I can utilize from VB to instruct SQL Server to fire the
package...???

like I said... just wondering...


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
There is nothing wrong with using WithEvents, but you need to implement
all event handlers. Events generally give you more information about
errors that some of the other mechanisms as well. Sample code there on
the site.

Darren

In message <ueHV4g#WFHA.3584 (AT) TK2MSFTNGP14 (DOT) phx.gbl>, Jim Fox
jimf (AT) imxinc (DOT) com> writes
Thanks for the help. Unfortunately, this did not do the trick... However,
after exploring the articles in the link you provided, I foud a solution.
Apparently, declaring a Package using the WITHEVENTS keyword is the
issue...
Once I removed WITHEVENTS everything worked fine.

Many thanks!

Jim

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:fJZy48J225iCFwxF (AT) sqldts (DOT) com...
Running DTS from VB is new to me, so apologies for the newbie
question.
I
have a DTS package which runs problem free in MMC. I wanted to
automate
the
execution using VB6. I've loaded the a Package2 object using the
LoadFromSQLServer method (which works fine), but the Execute method
fails
as
follows:

Error: x80040005
EXCEPTION_ACCESS_VIOLATION



Set the ExecuteInMainThread property to true.

Execute a package from Visual Basic (VB)
(http://www.sqldts.com/default.aspx?208)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




Reply With Quote
  #8  
Old   
Darren Green
 
Posts: n/a

Default Re: Problem Executing DTS Task from VB - 05-19-2005 , 09:49 AM



Not really. There is SQL-NS, nothing SQL-DMO, but this is UI based.

There is no way of executing a package on a remote machine, without running
a process on that machine, and then you get no feedback. Using a job is the
simplest method to abstract the execution away from the client and onto the
server, but no real-time feedback.


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Jim Fox" <jimf (AT) imxinc (DOT) com> wrote

Quote:
By the way... just wondering.... is there a simpler way to initiate
execution of a DTS package? I can see why the VB DTS library is so
useful... mainly for modifying / customizing DTS packages at runtime.
However, if I'm just interested in executing an existing package without
modifications, it seems that loading the package into a VB class and
executing is excessive... perhaps there's a command object (maybe in
SQL-DMO) that I can utilize from VB to instruct SQL Server to fire the
package...???

like I said... just wondering...


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:x75Z0QP1z6iCFwmo (AT) sqldts (DOT) com...
There is nothing wrong with using WithEvents, but you need to implement
all event handlers. Events generally give you more information about
errors that some of the other mechanisms as well. Sample code there on
the site.

Darren

In message <ueHV4g#WFHA.3584 (AT) TK2MSFTNGP14 (DOT) phx.gbl>, Jim Fox
jimf (AT) imxinc (DOT) com> writes
Thanks for the help. Unfortunately, this did not do the trick...
However,
after exploring the articles in the link you provided, I foud a
solution.
Apparently, declaring a Package using the WITHEVENTS keyword is the
issue...
Once I removed WITHEVENTS everything worked fine.

Many thanks!

Jim

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:fJZy48J225iCFwxF (AT) sqldts (DOT) com...
Running DTS from VB is new to me, so apologies for the newbie
question.
I
have a DTS package which runs problem free in MMC. I wanted to
automate
the
execution using VB6. I've loaded the a Package2 object using the
LoadFromSQLServer method (which works fine), but the Execute
method
fails
as
follows:

Error: x80040005
EXCEPTION_ACCESS_VIOLATION



Set the ExecuteInMainThread property to true.

Execute a package from Visual Basic (VB)
(http://www.sqldts.com/default.aspx?208)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org






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.