Wednesday, March 7, 2012

Error in Executing Bulk Load using SQLXML 4.0

I have a number of apps which do xml bulk load using sqlxml 4.0. But, in on
e
program when I attempt to execute the following
SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class bulkLoadObject = new
SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class();
I get this error raised.
"Unable to cast COM object of type 'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class'
to interface type 'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation faile
d
because the QueryInterface call on the COM component for the interface with
IID '{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE))."
While in another app the same statement executes with no problems.
I have no compile errors in the offending program. I have dropped the
reference and re-added a couple of times.
Does anyone have any insight?Could this be something related to the interop DLL in the GAC? What
happens when you refresh it?|||All the other apps that use SQLXML 4.0 bulk load on that machine have no
problems.|||Hello,
This is usually due to the fact that you are missing [STAThread] declaration
like in:
[STAThread]
static void Main()
Hope this helps,
Monica Frintu
"AlanS" wrote:

> I have a number of apps which do xml bulk load using sqlxml 4.0. But, in
one
> program when I attempt to execute the following
> SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class bulkLoadObject = new
> SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class();
> I get this error raised.
> "Unable to cast COM object of type 'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class
'
> to interface type 'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation fai
led
> because the QueryInterface call on the COM component for the interface wit
h
> IID '{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following
> error: No such interface supported (Exception from HRESULT: 0x80004002
> (E_NOINTERFACE))."
> While in another app the same statement executes with no problems.
> I have no compile errors in the offending program. I have dropped the
> reference and re-added a couple of times.
> Does anyone have any insight?

No comments:

Post a Comment