dbTalk Databases Forums  

DTS export runs in Wizard, but not when saved and run in VB

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


Discuss DTS export runs in Wizard, but not when saved and run in VB in the microsoft.public.sqlserver.dts forum.



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

Default DTS export runs in Wizard, but not when saved and run in VB - 05-13-2005 , 04:16 AM






Hi Experts

I have written a dts exporting data from SQL to Excel and the data is
exported fine, however when I save the dts as VB and run it from VB, it just
exports the headings of the table into Excel, but does not export the data in
the table. What am I doing wrong?

I know I have data in the table because after running the dts from the
wizard, I open the Excel file and the data is all there. However when I open
and run it in vb there is only the headings.

Thanx for all your help in advance

Kind Regards

Reply With Quote
  #2  
Old   
poppy
 
Posts: n/a

Default RE: DTS export runs in Wizard, but not when saved and run in VB - 05-13-2005 , 05:20 AM








"poppy" wrote:

Quote:
Hi Experts

I have written a dts exporting data from SQL to Excel and the data is
exported fine, however when I save the dts as VB and run it from VB, it just
exports the headings of the table into Excel, but does not export the data in
the table. What am I doing wrong?

I know I have data in the table because after running the dts from the
wizard, I open the Excel file and the data is all there. However when I open
and run it in vb there is only the headings.

Thanx for all your help in advance

Kind Regards
Hi again

I just stumbled on the fact that I forgot to include the password to the db
in the code and that is why I was not recieving the data from the table.

I have another question. It seems from the code that data can only be
manipulates as a group.

e.g. Set oColumn = oTransformation.SourceColumns.New("Discount", 13)
oColumn.Name = "Discount"
oColumn.Ordinal = 13
oColumn.Flags = 120
oColumn.Size = 0
oColumn.DataType = 131
oColumn.Precision = 10
oColumn.NumericScale = 2
oColumn.Nullable = True

I wonder if it is possible to manipulate data in every record? e.g.


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

Default RE: DTS export runs in Wizard, but not when saved and run in VB - 05-13-2005 , 05:33 AM



Why are you running the package like this? All you are doing is
rebuilding a package each and every invocation and then firing the
package. This will hurt for performance. If I is because you want to
manipulate properties of the package at runtime then you could probably
do this using a prebuilt package and calling that through VB.

Once you have that then you can change properties of the package in your
code. You could also do this using the Dynamic Properties task or by
passing in variable values on the cmdline through the /A switch.



"poppy" <poppy (AT) discussions (DOT) microsoft.com> wrote


Quote:
"poppy" wrote:

Hi Experts

I have written a dts exporting data from SQL to Excel and the data is
exported fine, however when I save the dts as VB and run it from VB, it just
exports the headings of the table into Excel, but does not export the data in
the table. What am I doing wrong?

I know I have data in the table because after running the dts from the
wizard, I open the Excel file and the data is all there. However when I open
and run it in vb there is only the headings.

Thanx for all your help in advance

Kind Regards

Hi again

I just stumbled on the fact that I forgot to include the password to the db
in the code and that is why I was not recieving the data from the table.

I have another question. It seems from the code that data can only be
manipulates as a group.

e.g. Set oColumn = oTransformation.SourceColumns.New("Discount", 13)
oColumn.Name = "Discount"
oColumn.Ordinal = 13
oColumn.Flags = 120
oColumn.Size = 0
oColumn.DataType = 131
oColumn.Precision = 10
oColumn.NumericScale = 2
oColumn.Nullable = True

I wonder if it is possible to manipulate data in every record? e.g.


Reply With Quote
  #4  
Old   
poppy
 
Posts: n/a

Default RE: DTS export runs in Wizard, but not when saved and run in VB - 05-13-2005 , 05:47 AM



Hi Allan

This is cause I don't know any better. In fact I started working with dts
yesterday. I'm actually trying to help a collegue of mine. He says he has a
number of dtss in sql and he wants to be able to store and fire them all in
vb with out the object model? (not quite sure about this) He also wants to be
able to manipulate each record when and if he needs to.

How would I go about doing this: "prebuilt package and calling that through
VB.
Once you have that then you can change properties of the package in your
code. You could also do this using the Dynamic Properties task or by
passing in variable values on the cmdline through the /A switch."

Thanx for all your help

Kind Regards

"Allan Mitchell" wrote:

Quote:
Why are you running the package like this? All you are doing is
rebuilding a package each and every invocation and then firing the
package. This will hurt for performance. If I is because you want to
manipulate properties of the package at runtime then you could probably
do this using a prebuilt package and calling that through VB.

Once you have that then you can change properties of the package in your
code. You could also do this using the Dynamic Properties task or by
passing in variable values on the cmdline through the /A switch.



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

Default RE: DTS export runs in Wizard, but not when saved and run in VB - 05-13-2005 , 08:09 AM



If they do not want to execute it using the Object Model then rebuilding
the package every time is not fulfilling that wish then.

Use DTS Designer and build the package. Anything you need to set
dynamically then you can have the package read from external locations
using the Dynamic Properties task. You could also set properties in the
package using Global Variables and set those Global Variables using the
/A switch to DTSRUN.

You can find all kinds of examples of doing things in DTS on this site.
Try this article for a start

Building a Package in the DTS Designer
(http://www.sqldts.com/default.aspx?278)


"poppy" <poppy (AT) discussions (DOT) microsoft.com> wrote


Quote:
Hi Allan

This is cause I don't know any better. In fact I started working with dts
yesterday. I'm actually trying to help a collegue of mine. He says he has a
number of dtss in sql and he wants to be able to store and fire them all in
vb with out the object model? (not quite sure about this) He also wants to be
able to manipulate each record when and if he needs to.

How would I go about doing this: "prebuilt package and calling that through
VB.
Once you have that then you can change properties of the package in your
code. You could also do this using the Dynamic Properties task or by
passing in variable values on the cmdline through the /A switch."

Thanx for all your help

Kind Regards

"Allan Mitchell" wrote:

Why are you running the package like this? All you are doing is
rebuilding a package each and every invocation and then firing the
package. This will hurt for performance. If I is because you want to
manipulate properties of the package at runtime then you could probably
do this using a prebuilt package and calling that through VB.

Once you have that then you can change properties of the package in your
code. You could also do this using the Dynamic Properties task or by
passing in variable values on the cmdline through the /A switch.



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.