dbTalk Databases Forums  

VB Code it generates

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


Discuss VB Code it generates in the microsoft.public.sqlserver.dts forum.



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

Default VB Code it generates - 01-28-2004 , 03:55 PM






I noticed that you can save the dts package as a visual
basic module. If you do that, how can you execute the
code? Do you have to do additional programming or is it a
plug-and-play type of scenario.

I made a form and included the references for DTS using
VB6, but it did not work. In fact, it didn't do anything.

Any suggestions?

Reply With Quote
  #2  
Old   
Ross McKay
 
Posts: n/a

Default Re: VB Code it generates - 01-28-2004 , 04:16 PM






On Wed, 28 Jan 2004 13:55:49 -0800, "Mike"
<anonymous (AT) discussions (DOT) microsoft.com> wrote:

Quote:
I noticed that you can save the dts package as a visual
basic module. If you do that, how can you execute the
code? Do you have to do additional programming or is it a
plug-and-play type of scenario.

I made a form and included the references for DTS using
VB6, but it did not work. In fact, it didn't do anything.
If you have a read of the code, you will see that it is a stand-alone
module with a Sub Main(). The code builds up a DTS package, and at the
end of the procedure is code for either executing or saving the package
(with the SaveToSQLServer call commented out).

The fact that it doesn't do anything suggests that the VB project is set
to run the form, not Sub Main(), at startup. If your VB form called
Main() it would create and execute the package.

cheers,
Ross.
--
Ross McKay, WebAware Pty Ltd
"The lawn could stand another mowing; funny, I don't even care"
- Elvis Costello


Reply With Quote
  #3  
Old   
Noah Ganter
 
Posts: n/a

Default Re: VB Code it generates - 02-03-2004 , 07:17 AM



The VB code that can be generated at the end of a DTS package is most easily
handled by compiling it with VB 6.0. You can use the .NET framework, but if
you look at the code you can see it is not necessary to have the .NET
framework installed. You *will* need to include a reference to the DTS
classes/libraries before you compile or it will fail (On one of the menu
items you can pull down to 'references' and get a long, long list of classes
to reference. Reference Microsoft DTS packages). In fact, even after
compling you may find the .exe that is created fails occasionally. The best
solution is to step around complining the VB code althougher and saving the
package as SQL Server, and then access this package within SQL Server using
xp_cmdshell 'c:\dtsrun packagename'

-Noah Ganter
"Mike" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I noticed that you can save the dts package as a visual
basic module. If you do that, how can you execute the
code? Do you have to do additional programming or is it a
plug-and-play type of scenario.

I made a form and included the references for DTS using
VB6, but it did not work. In fact, it didn't do anything.

Any suggestions?



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.