PC Review


Reply
Thread Tools Rate Thread

DCom interface ... Please help!

 
 
Bruce
Guest
Posts: n/a
 
      20th Feb 2007
I need to re-write an old .ASP application in a C# webservice. No problem,
right? Well, I also need to use a DCom object to connect to our SAP system.
Unfortunately, I'm unable to make that work.

It seems that, even though SAP requires an ADODB.Recordset object passed,
the DCom specification says it requires an object. So .Net won't let me use
anything but an object while SAP bombs out when it received anything but a
Recordset. Here is the code I currently have:

------------------------------------------------------------------------------------------
//Declare a set of objects and recordsets used for local and remote (SAP)
systems
Object oProEMat, oReturn;
ADODB.Recordset rsProEMat, rsReturn;
rsProEMat = new ADODB.Recordset();
rsReturn = new ADODB.Recordset();
oProEMat = new ADODB.Recordset();
oReturn = new ADODB.Recordset();

//This defines the record set(s) with field names, data types, etc... based
on the SAP function reference via DCOM
oSAPMaterial.DimAs("BapiGetMaterialBasic", "MaterialBasic", ref oProEMat);
oSAPMaterial.DimAs("BapiGetMaterialBasic", "Return", ref oReturn);

//Use the returned structure from the definition statement (DimAs) to create
a new recordset
rsProEMat = (ADODB.Recordset)oProEMat;

//Add a new record assigning field 'Matnr' to the value strMatnr
rsProEMat.AddNew("Matnr", strMatnr);

//Reassign the recordset back to the generic object
oProEMat = new ADODB.Recordset();
oProEMat = (ADODB.Recordset)rsProEMat;

//Using the generic objects, call SAP function via DCOM
oSAPMaterial.BapiGetMaterialBasic(ref oProEMat, ref oReturn);
------------------------------------------------------------------------------------------

The last statement returns error
'System.Runtime.InteropServices.COMException: Exception from HRESULT:
0x80040E21'. When I check SAP, it gives an error stating an unhandled
variable type was passed.

Anyone have any ideas?

Bruce


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DCOM error, the server did not register with dcom Gordon J. Rattray Windows XP General 0 3rd Jan 2010 03:11 AM
Smart Pointers (SQLDMO): Acquiring SQLServer2 interface from SQLServer interface? Mark Findlay Microsoft Dot NET 1 23rd Dec 2005 10:08 AM
DCOM access denied attempting to launch a DCOM etc Help!! =?Utf-8?B?Sm9obiBOaXZhcmQ=?= Microsoft Windows 2000 3 2nd Jun 2004 01:00 PM
DCOM: DCOM got error "Overlapped I/O Jeffry Microsoft Windows 2000 Advanced Server 0 13th Feb 2004 12:04 AM
Accessing DCOM components from the code behind pages and using sessions to store DCOM object handles Alex Microsoft ASP .NET 3 2nd Dec 2003 01:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:12 AM.