dbTalk Databases Forums  

VBScript and DTS... what gives?

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


Discuss VBScript and DTS... what gives? in the microsoft.public.sqlserver.dts forum.



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

Default VBScript and DTS... what gives? - 10-12-2003 , 02:04 PM






I've been poking around this newsgroup enough to come to the
conclusion that Microsoft didn't design the DTS object model to be
friendly to VBScript. This perplexes me, and I'm wondering if anyone
can explain why? It seems like such an obvious candidate for a
scriptable interface. And I haven't run into this kind of problem
with other COM models for SQL Server (ADO, DMO, etc.).

What were they thinking? Or were they just lazy?

The case in point at the moment is the type mismatch problem with
GetExecutionErrorInfo, which Darren Green has posted about many times.
GetExecutionErrorInfo takes a ByRef Long parameter, and VBScript
can't do that. I know there are workarounds for this, but they're
painful (i.e. they all require a compiled language.)

Can anyone offer any insight into this issue? And is there any chance
we might see an update to DTS to address this? (I'm not going to hold
my breath... they've already extended the interfaces to xxxx2 in many
cases, which seems to be the end of the line most of the time.)

Or am I using the wrong tool? The task I'm trying to accomplish is to
import data from an Access .mdb file into SQL Server. Is there
something else I should use to accomplish this from script? I
exported a DTS job to Visual Basic, and I'm trying to translate that
into VBScript.

Thanks,

Allan

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

Default Re: VBScript and DTS... what gives? - 10-13-2003 , 12:59 PM






In article <d563b154.0310121104.32083ccb (AT) posting (DOT) google.com>, Allan Cady
<allancady (AT) yahoo (DOT) com> writes
Quote:
I've been poking around this newsgroup enough to come to the
conclusion that Microsoft didn't design the DTS object model to be
friendly to VBScript. This perplexes me, and I'm wondering if anyone
can explain why? It seems like such an obvious candidate for a
scriptable interface. And I haven't run into this kind of problem
with other COM models for SQL Server (ADO, DMO, etc.).

What were they thinking? Or were they just lazy?

The case in point at the moment is the type mismatch problem with
GetExecutionErrorInfo, which Darren Green has posted about many times.
GetExecutionErrorInfo takes a ByRef Long parameter, and VBScript
can't do that. I know there are workarounds for this, but they're
painful (i.e. they all require a compiled language.)

Can anyone offer any insight into this issue? And is there any chance
we might see an update to DTS to address this? (I'm not going to hold
my breath... they've already extended the interfaces to xxxx2 in many
cases, which seems to be the end of the line most of the time.)

Or am I using the wrong tool? The task I'm trying to accomplish is to
import data from an Access .mdb file into SQL Server. Is there
something else I should use to accomplish this from script? I
exported a DTS job to Visual Basic, and I'm trying to translate that
into VBScript.

Thanks,

Allan

The use of ByRef parameters is a pain if working in script, but you can
get basic success or fail info by checking the step ExecutionResult
property. This is of course not as good as the error message itself.

You are aware of the workarounds then, and that is the best you can do,
other than not using a script language or similar that does not support
strong types..

It isn't great but that's the best we have for now.

You can send request for future features and enhancements to
sqlwish (AT) microsoft (DOT) com. Describe what you would like and also justify it
as appropriate. These mails are read.

--
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.