dbTalk Databases Forums  

Unspecified error when using Bulk Export task with Activex from sqldts.com

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


Discuss Unspecified error when using Bulk Export task with Activex from sqldts.com in the microsoft.public.sqlserver.dts forum.



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

Default Unspecified error when using Bulk Export task with Activex from sqldts.com - 07-12-2004 , 08:06 PM






I am using the Bulk Export task with an ActiveX script. The script was
working fine a couple of days ago, but for some reason has stopped
working now. I am trying to dynamically set the ObjectName and the
ExportFile properties in the ActiveX script, but the script fails when
setting the ObjectName. The only error given is Unspecified Error.

I've tried debugging the script in VS.NET, but am unable to find any
more details on the problem there.

The portion of the script that is causing problems is shown below, and
it is failing on the line:

bulkExport.Properties("ObjectName").value = sTableName
TIA for any assistance.

Function Main()
Dim tableArray
dim bulkExport
dim sTableName
dim stpEnterLoop
dim stpFinished
dim pkg

set pkg = DTSGlobalVariables.Parent
set stpEnterLoop = pkg.Steps("DTSStep_DTSBulkExport.ExportData_1")
set stpFinished = pkg.Steps("DTSStep_DTSActiveScriptTask_2")

if DTSGlobalVariables("gvTableCount").Value <
DTSGlobalVariables("gvTotalTables").Value Then

stpEnterLoop.DisableStep = False
stpFinished.DisableStep = True
tableArray = DTSGlobalVariables("gvTableNames").Value

sTableName = trim(tableArray(DTSGlobalVariables("gvTableCount") .Value))

set bulkExport = pkg.Tasks("DTSTask_DTSBulkExport.ExportData_1").Cu stomTask
bulkExport.Properties("ObjectName").value = sTableName
bulkExport.Properties("ExportFile").value =
DTSGlobalVariables("gvExportDirectory").Value & sTableName & ".txt"

DTSGlobalVariables("gvTableCount").Value =
DTSGlobalVariables("gvTableCount").Value + 1

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

Default Re: Unspecified error when using Bulk Export task with Activex from sqldts.com - 07-13-2004 , 02:31 AM






First check that your ActiveX Script Task is Execute on main thread, under
workflow properties for that task.
Assuming that is set then I can only assume it is the value itself that you
are trying to set that is causing problems.

You could try logging the variable value or just throwing it count via
MsgBox. You could also try using CStr to try and force and bad data into a
string. This might highlight the problem.

bulkExport.Properties("ObjectName").value = CStr(sTableName)

Not the problem here I suspect, but I always use Option Explicit as well as
this often catches silly mistakes in script.

Darren Green
http://www.sqldts.com

"Allister Farn" <a_farnsworthy (AT) yahoo (DOT) com.au> wrote

Quote:
I am using the Bulk Export task with an ActiveX script. The script was
working fine a couple of days ago, but for some reason has stopped
working now. I am trying to dynamically set the ObjectName and the
ExportFile properties in the ActiveX script, but the script fails when
setting the ObjectName. The only error given is Unspecified Error.

I've tried debugging the script in VS.NET, but am unable to find any
more details on the problem there.

The portion of the script that is causing problems is shown below, and
it is failing on the line:

bulkExport.Properties("ObjectName").value = sTableName
TIA for any assistance.

Function Main()
Dim tableArray
dim bulkExport
dim sTableName
dim stpEnterLoop
dim stpFinished
dim pkg

set pkg = DTSGlobalVariables.Parent
set stpEnterLoop = pkg.Steps("DTSStep_DTSBulkExport.ExportData_1")
set stpFinished = pkg.Steps("DTSStep_DTSActiveScriptTask_2")

if DTSGlobalVariables("gvTableCount").Value
DTSGlobalVariables("gvTotalTables").Value Then

stpEnterLoop.DisableStep = False
stpFinished.DisableStep = True
tableArray = DTSGlobalVariables("gvTableNames").Value

sTableName = trim(tableArray(DTSGlobalVariables("gvTableCount") .Value))

set bulkExport =
pkg.Tasks("DTSTask_DTSBulkExport.ExportData_1").Cu stomTask
bulkExport.Properties("ObjectName").value = sTableName
bulkExport.Properties("ExportFile").value =
DTSGlobalVariables("gvExportDirectory").Value & sTableName & ".txt"

DTSGlobalVariables("gvTableCount").Value =
DTSGlobalVariables("gvTableCount").Value + 1



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.