cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble shooting addon

lucas_fischer
Active Participant
0 Kudos

Experts,

I am tasked with troubleshooting some custom development at a customer's site, and am running into the following error when running an automated process.

Unable to cast COM object of type 'System.__ComObject' to interface type 'SAPbobsCOM.Recordset'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{8CA3AB92-1930-4511-4AA8-82D53C3150C3}' failed due to the following error: Old format or invalid type library. (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT)).

The reference that follows points to this line of code.

Recordset rs = null;

if (rs != null)

{

System.Runtime.InteropServices.Marshal.ReleaseComObject(rs);

rs = null;

GC.WaitForPendingFinalizers();

GC.Collect();

}

rs = (Recordset)Company.GetBusinessObject(BoObjectTypes.BoRecordset); This is the line that fails.

rs.DoQuery(pQuery);

return rs;

Any suggestions would be greatly appreciated.

kindest regards,

Lucas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try:

rs = Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

Thanks,

Gordon

Answers (1)

Answers (1)

former_member201110
Active Contributor
0 Kudos

Hi Lucas,

That code works fine for me. I'm assuming you have a using directive for SAPbobsCOM in your code.

Tested on SBO 8.8 in VS 10 (slight tweak for change of object names):


Recordset rs = null;

 if (rs != null) // Not sure why this is needed as rs will always be null but leaving it in anyway
 {
     System.Runtime.InteropServices.Marshal.ReleaseComObject(rs);
     rs = null;
     GC.WaitForPendingFinalizers();
     GC.Collect();
}

rs = (Recordset)sbo.Company.GetBusinessObject(BoObjectTypes.BoRecordset); // This works

Can you instantiate any other objects from the DI API? Is your Company object instantiated and connected? Is it just one machine that has the error? What version of SBO are you using?

Kind Regards,

Owen

Former Member
0 Kudos

Hi guys!

I have the same exceptions from times to times.

It might happen when i'm trying to create instance of Recordset or when i'm trying to execute query.

It might happen with another DI objects, e.g. Service Call, method GetByKey():

this is in my log:

exception message:

Old format or invalid type library. (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT))

the last step in stack trace:

at SAPbobsCOM.IRecordset.DoQuery(String QueryStr)

or:

exception message:

Old format or invalid type library. (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT))

the last step in stack trace:

at SAPbobsCOM.IServiceCalls.GetByKey(Int32 ServiceCallID)

Also, i found out, that this is being happened after DI Company has been re-created (released and then created again)

It might not be a condition of an issue, or might be.

SAP guys, could you comment that ?

Former Member
0 Kudos

Hi,

i have the Same problem like Konstantin Ryahovsky .

In my Addon it is a Import and the Import runs over 1hour.

Anytime i get the same Error and the Import stopps.

I only Import Businesspartners. What is the Problem ?

Thanks Dhoams