Microsoft KB Archive/297155

{|
 * width="100%"|

FIX: DTS Error Message: &quot;Cannot Load, Save or Execute the Package if some objects do not have a Name. Please specify Names for these objects.&quot;

 * }

Q297155

Microsoft SQL Server 2000

-

The information in this article applies to:


 * Microsoft SQL Server 2000 (all editions)

-

BUG #: 236263 (SHILOH_BUGS)

SYMPTOMS
When you run a Data Transformation Services (DTS) package that is saved as a Visual Basic file in the Microsoft Visual Basic development environment, the following error may occur if the DTS package contains any custom tasks:

Run-time error '-2147220465 (8004040f)':

Cannot Load, Save or Execute the Package if some objects do not have a Name. Please specify Names for these objects.

CAUSE
When a DTS package that contains a custom task is saved as a Visual Basic file, the name property for the custom task is not scripted, which causes the error.

RESOLUTION
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, please see the following article in the Microsoft Knowledge Base:

"Q290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack"

WORKAROUND
To resolve the problem, assign a value to the Name property of the Task object. The following is an extract of the Visual Basic script that is created for the package that contains a custom task:

Public Sub Task_Sub1(ByVal goPackage As Object)

Dim oTask As DTS.Task Dim oLookup As DTS.Lookup

Dim oCustomTask1 As SimpleCT.CSimple Set oTask = goPackage.Tasks.New(&quot;SimpleCT.CSimple&quot;) Set oCustomTask1 = oTask.CustomTask

goPackage.Tasks.Add oTask Set oCustomTask1 = Nothing Set oTask = Nothing

End Sub Add the following code before the goPackage.Tasks.Add statement:

oTask.Name = &quot;DTSTask_SimpleCT.CSimple_1&quot; If the package contains multiple custom tasks, set the name property of all of the tasks to avoid the error.

STATUS
Microsoft has confirmed this to be a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

Steps to Reproduce Behavior

 * 1) Use Visual Basic and create a custom task DLL as described in the &quot;custom tasks&quot; topic in SQL Server 2000 Books Online.
 * 2) Use Enterprise Manager for Microsoft SQL Server 2000 and create a new package.
 * 3) Register the Custom Task, and then create one instance of the Custom Task in the package.
 * 4) Execute the package and it should work. Save the package as a Visual Basic script.
 * 5) Open Visual Basic and create a new executable project.
 * 6) Add references to the Microsoft DTS Package Object library and the Custom Task DLL created earlier.
 * 7) Add the module that was created when the DTS Package was scripted as a Visual Basic file to the project.

Additional query words: custom task VB DTS

Keywords : kbDSupport kbSQLServ2000bug kbSQLServ2000sp1fix kbgrpdsvc

Issue type : kbbug

Technology : kbSQLServSearch kbAudDeveloper kbSQLServ2000Search kbSQLServ2000