3

I'm trying to determine what level of effort would be required to develop an OGIS Ole db provider for ArcGIS.

There is a sample that is read-only. I would like to be able to edit featureclasses in the ole db workspace using the out-of-the-box editing tools in ArcMap. Plus, I would prefer to develop in C# instead of C++.

I see that there was an effort to do this with zigGIS, but it never was completed.

Does anyone know of sample code showing how to do this?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Kirk Kuykendall
  • 25,787
  • 8
  • 65
  • 153

1 Answers1

1

I have gone this route in the past. Honestly, unless there is an OLEDB-specific reason you need (like it needs to be able to be accessible from Excel), I would stay clear from it.

Instead, use the PluginWorkspace pipeline to add read&write datasets to ArcGIS. I have a full-blown working one at my GitHub written in C# which adds full GDAL/OGR support. You can edit it to suit your own case since it is Open Source.

Although that is read-only, you can add write support with a couple days more worth of work.

By the way, the ArcGIS documentation says that you can only do read-only through the PluginWorkspace pipeline. That is not true anymore. After 10.1 SP1 (see NIM083294), you can add write support.

How?

Implement ITable and ITableWrite on your Dataset object.

Pull-requests are always welcome.

Ragi Yaser Burhum
  • 15,339
  • 2
  • 59
  • 76
  • Thanks! I hadn't realized that write capabilities was supported for Plugins. That's the only reason I was looking at ole db. I haven't downloaded your code yet. Does "write" support mean I can edit using the standard editing tools? – Kirk Kuykendall Dec 10 '12 at 23:12
  • @KirkKuykendall As far as I was told by ESRI, the answer is 'yes'. I have not done it yet because this capability has been there only since October/November. – Ragi Yaser Burhum Dec 10 '12 at 23:26
  • Thanks, I will go with the plugin approach. Still, just curious, would you happen to know if implementing an OGC ole db provider and registering it in an appropriate COM category would cause it to appear under the dropdown list of available database connections when adding a new SQL Query layer? I'm not going to mark this as the accepted answer since it didn't really answer my question. However it has been very helpful in my particular situation. – Kirk Kuykendall Dec 15 '12 at 16:37
  • If I remember correctly, there is a particular component category for that. But honestly, the OleDB functionality was created prior to 2001 - it is not the right way to go – Ragi Yaser Burhum Dec 16 '12 at 15:15
  • Ragi, great to know that write capability has been added! – Petr Krebs Dec 16 '12 at 21:41
  • 1
    I'll try to fork it and add some functionality. – Petr Krebs Dec 18 '12 at 20:21
  • Awesome @PetrKrebs! Looking forward to seeing those changes. – Ragi Yaser Burhum Dec 18 '12 at 21:53
  • Okay, I tried to implement ITable and ITableWrite on the dataset, but no member of these interfaces ever gets called. ArcMap still says the layer is not editable. Perhaps there is something else which needs to be done? – Petr Krebs Dec 19 '12 at 16:11
  • Good changes. Thanks for the cleanup. Shoot me an e-mail and ragi at burhum com and we can debug this offline. – Ragi Yaser Burhum Dec 19 '12 at 19:02
  • 1
    @PetrKrebs Also, if you can post the ITable & ITableWrite implementation in a branch, so I can see it. I found the cleanups on your branch, but no implementation of those interfaces. Good stuff man. – Ragi Yaser Burhum Dec 19 '12 at 19:11