Monday, April 18, 2011

This one is a real Keeper

So, if you ever get this error while trying to work with OleDb and SAS IOM:

The object ... could not be found; make sure it was previously added to the object keeper

Make sure that you include the following lines (the lack of a Keeper is what causes this error):

ObjectFactory factory = new ObjectFactory();
ServerDef server = new ServerDef();
Workspace ws = (Workspace)factory.CreateObjectByServer("ws", true, server, "", "");
ObjectKeeper keeper = new ObjectKeeper();
keeper.AddObject(1, "SASServer", ws);

That whole ObjectKeeper is missing from a number of examples that I have seen and it is critical for everything to function. It becomes apparent when trying to get the data from an OleDb DataAdaptor.

1 comment:

Anonymous said...

Thank you!!! Would have taken me forever to figure this out. I'm completely unfamiliar with SAS - trying to update some old .Net code (with new 64-bit platform, new SAS version, etc.) -Walt

Cisco Information Server (CIS) and MS OLAP

Ok, so my recent issue was integrating CIS with Microsoft OLAP cubes. The normal way to do this is to set up MS OLAP (SSAS) with a website a...