FIX: DTSTransferObjects with Events Generates an Error Message and an Access Violation in Visual Basic
Symptoms
This article describes one possible reason why a Data Transformation Services (DTS) package created in Microsoft Visual Basic code may fail with an error message and an access violation (AV).
When you create a DTSTransferObjectsTask task in a DTS package and specify the WITHEVENTS keyword, and you then run the DTS package from Microsoft Visual Basic code, the package may fail with the following error message:
ErrorCode: -2147221499
Source: Microsoft Data Transformation Services (DTS) Package
Description: Need to run the object to perform this operation After you set a breakpoint at the beginning of the OnProgress procedure, and you single step through your OnProgress code in Visual Basic, you will see the underlying access violation (AV):
Package failed error: x80040005, x80040000 + 5
Provider generated code execution exception: EXCEPTION_ACCESS_VIOLATION Then, Dr. Watson shows an error message similar to the following:
The instruction at “0×0fa9183f” referenced memory at “0×00000001″. The memory could not be “read”. When you run the Visual Basic application under the debugger WinDbg you will see a first chance exception of type access violation in OLEAUT32!SysAllocStringByteLen.
NOTE: This article is specifically about the OnProgress event of a DTSTransferObjectsTask!
The most common causes for the error message and access violation when you use DTS in Visual Basic applications are described in the following Microsoft Knowledge Base article:
271889?(http://support.microsoft.com/kb/271889/EN-US/) PRB: Error Message: “Exception Access Violation 2147221499.Need to run the object to perform this operation” Occurs When You Run a DTS Package in Microsoft Visual Basic Code
Resolution
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211?(http://support.microsoft.com/kb/290211/EN-US/) INF: How To Obtain the Latest SQL Server 2000 Service PackNOTE: The following hotfix was created before the release of Microsoft SQL Server 2000 Service Pack 3.
The English version of this fix should have the following file attributes or later:
DateTimeVersionSizeFile name————————————————————–06-Jan-200220:238.00.5661,901,120 bytesDtspkg.dll NOTE: Because of file dependencies, the most recent hotfix or feature that contains the files may also contain additional files.
