1

Making an Add-In for ArcMap, refactoring old VBA code into VB.NET. Trying to create a new workspace with ArcObjects in VB.NET.

I am getting the error:

BC30002 Type "OLEDBWorkspaceFactory" is not defined

I tried this example IWorkspaceFactory2 Example, but I was also getting the same error with SdeWorkspaceFactory not being defined.

Below is how the code looks like. How would you rewrite it to work?

Dim pWorkspaceFact As IWorkspaceFactory2
pWorkspaceFact = New OLEDBWorkspaceFactory

Dim pWorkspace As IWorkspace
pWorkspace = pWorkspaceFact.Open(pPropSet, 0)

Dim pEnumDatasetNames As IEnumDatasetName
pEnumDatasetNames = pWorkspace.DatasetNames(esriDTTable)
  • 2
    Is this a standalone exe? If so, if you don't initialize (checkout) an Esri license, trying to create a workspace object can throw an exception. – Kirk Kuykendall Feb 19 at 15:34
  • It's an add-in for ArcMap, so I'm trying to make a custom button. Do I need to initiliaze an Esri License for an add-in? – Anna3anana Feb 20 at 7:04
2

This code works, I just made a typo blunder! It was a small typo in my namespace that I referenced in.

I wrote

Imports ESRI.ArcGIS.DatasourcesOledDB

When it should have been

Imports ESRI.ArcGIS.DataSourcesOleDB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.