XML problem

Hello everybody I'm trying to use SQLXMLBULKLOAD COM-Object in a VC++ project, I wrote a VB client and the following code seems to work well but when I try to write the same code in my VC++ project I receive an error in Execute method
Here you are the VB Code
Dim objBulkLoad As New SQLXMLBULKLOADLib.SQLXMLBulkLoad3
objBulkLoad.ConnectionString = "PROVIDER=SQLOLEDB;SERVER=(local);DATABASE=MyDB;INTEGRATED SECURITY=sspi"
objBulkLoad.KeepIdentity = False
objBulkLoad.CheckConstraints = False
objBulkLoad.IgnoreDuplicateKeys = False
objBulkLoad.ForceTableLock = False
objBulkLoad.Transaction = True

objBulkLoad.ErrorLogFile = "C:\errorlog.xml"

objBulkLoad.Execute "C:\import.xsd", "C:\import.xml"
Set objBulkLoad = Nothing

And here you are the VC++ Code
LPTSTR pstr = buf.GetBufferSetLength(nOrigLength);
_bstr_t stream((BSTR) buf.AllocSysString(),false);
HRESULT hr = CoInitialize(NULL);
ISQLXMLBulkLoad* pBulk = NULL;
hr = CoCreateInstance(CLSID_SQLXMLBulkLoad3,NULL,CLSCTX_INPROC_SERVER,IID_ISQLXMLBulkLoad,reinterpret_cast<void **>(&pBulk));
hr = pBulk->put_KeepIdentity(0);
hr = pBulk->put_CheckConstraints(0);
hr = pBulk->put_IgnoreDuplicateKeys(0);
hr = pBulk->put_ForceTableLock(0);
hr = pBulk->put_Transaction(1);
hr = pBulk->put_ErrorLogFile(BSTR("C:\\errorilog.xml"));
hr = pBulk->put_ConnectionString(BSTR("PROVIDER=SQLOLEDB;SERVER=local;DATABASE=MyDB;INTEGRATED SECURITY=sspi"));
hr = pBulk->Execute(L"C:\\import.xsd");

Thank you everybody
[1663 byte] By [joecre] at [2007-11-19 1:59:26]
# 1 Re: XML problem
OK you wote some VB code (may the gods forgive you), You then tried to compile the same code in VC++ ? And you are surprised it doesn't work ?
Or you wrote some different code which doesn't work, yet you neglect to post that code, or even the error message you recieved.

Do you really expect people to help you with this, when you won't give us even the most basic information to help see what the problem might be.

Finally I would say that you probably have more chance of getting help in the VC forums, I would think that forum is more frequently visited, by people how knows where to look this up in the VC++ documentation, for you. I'am not a VC++ kind of guy, so I won't bother with that.
khp at 2007-11-10 3:27:57 >
# 2 Re: XML problem
Sorry but if you read my message well you can find both VB and VC++ code....sorry I didn't mean to hurt your feelings....bye
joecre at 2007-11-10 3:29:00 >