Any C++ ODBC developers out there?
-
I have a custom ADO.NET driver I have developed and it works just fine. However, I was thinking it would be great to be able to expose my data via ODBC as well, so I will need a custom ODBC driver that wraps around an ADO.NET driver, basically an ADO.NET -> ODBC bridge of sorts. I've seen several ODBC toolkits available but not being a C++ programmer I am pretty stuck in doing this myself. Does anyone know of a tool or open source project that offers something similar, an ADO.NET to ODBC bridge?
-
I have a custom ADO.NET driver I have developed and it works just fine. However, I was thinking it would be great to be able to expose my data via ODBC as well, so I will need a custom ODBC driver that wraps around an ADO.NET driver, basically an ADO.NET -> ODBC bridge of sorts. I've seen several ODBC toolkits available but not being a C++ programmer I am pretty stuck in doing this myself. Does anyone know of a tool or open source project that offers something similar, an ADO.NET to ODBC bridge?
Is there any real business reason why you wan0t to go through the pain? Writing an ODBC driver is very painful. The only thing more painful than writing an ODBC driver is writing an OLEDB provider. If you are already wrapping a C function than probably an ODBC driver is a good idea. In that case your ODBC driver will be a wrapper around the original C functions which your ADO.NET driver wraps.
-
Is there any real business reason why you wan0t to go through the pain? Writing an ODBC driver is very painful. The only thing more painful than writing an ODBC driver is writing an OLEDB provider. If you are already wrapping a C function than probably an ODBC driver is a good idea. In that case your ODBC driver will be a wrapper around the original C functions which your ADO.NET driver wraps.
There is a really good business reason. Pretty much every application that works with data supports reading from an ODBC compliant driver or data source, so it is a big market of potential end-users, unlike my ADO.NET driver which is limited to being used only from within .NET itself. My app is a data provider, not consumer (in which case just using ADO.NET would have been fine). So I need to expose my data to the outside world and ODBC seems to still be the defacto standard after all this time.
-
I have a custom ADO.NET driver I have developed and it works just fine. However, I was thinking it would be great to be able to expose my data via ODBC as well, so I will need a custom ODBC driver that wraps around an ADO.NET driver, basically an ADO.NET -> ODBC bridge of sorts. I've seen several ODBC toolkits available but not being a C++ programmer I am pretty stuck in doing this myself. Does anyone know of a tool or open source project that offers something similar, an ADO.NET to ODBC bridge?
Well, I never managed to figure out the ODBC, however, you can make COM calls to legacy ADO (NOT ADO.NET) which supports ODBC connections ... come to think of it so does ADO.NET. Also, let me say that while I never got direct ODBC working (I gave up after a few hours) the few snippets I found looked lean and mean compared to the VB6 crap I was writing at the time.
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
-
Well, I never managed to figure out the ODBC, however, you can make COM calls to legacy ADO (NOT ADO.NET) which supports ODBC connections ... come to think of it so does ADO.NET. Also, let me say that while I never got direct ODBC working (I gave up after a few hours) the few snippets I found looked lean and mean compared to the VB6 crap I was writing at the time.
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
Thanks for the reply. Actually I have done heaps with ODBC, even wrote a custom ODBC toolkit back when I used to code in Delphi, to completely replace the dreadful BDE (Borland Database Engine). The problem I have is I don't do C++ and just getting some of the examples I've found to compile is a nightmare. The idea is simple, expose an ADO.NET driver to ODBC clients using a bridge. The main agony will be wrapping the ADO.NET driver into a COM DLL, hosting that inside the C++ ODBC driver, and doing the data translation between C# DataTables and ODBC's own internal structures. Doable, but I am not up to it from the C++ end of things. I have seen some toolkits from DataDirect and Simba, but these cost upwards of $2k, not within my budget, and they still require C++!
-
I have a custom ADO.NET driver I have developed and it works just fine. However, I was thinking it would be great to be able to expose my data via ODBC as well, so I will need a custom ODBC driver that wraps around an ADO.NET driver, basically an ADO.NET -> ODBC bridge of sorts. I've seen several ODBC toolkits available but not being a C++ programmer I am pretty stuck in doing this myself. Does anyone know of a tool or open source project that offers something similar, an ADO.NET to ODBC bridge?
Never tried to build an ODBC driver... still, you could have a look at some existing drivers so you can get an idea on how it looks like. Here's an ODBC driver for SQLite[^], and hopefully you'll find it useful.
-
Thanks for the reply. Actually I have done heaps with ODBC, even wrote a custom ODBC toolkit back when I used to code in Delphi, to completely replace the dreadful BDE (Borland Database Engine). The problem I have is I don't do C++ and just getting some of the examples I've found to compile is a nightmare. The idea is simple, expose an ADO.NET driver to ODBC clients using a bridge. The main agony will be wrapping the ADO.NET driver into a COM DLL, hosting that inside the C++ ODBC driver, and doing the data translation between C# DataTables and ODBC's own internal structures. Doable, but I am not up to it from the C++ end of things. I have seen some toolkits from DataDirect and Simba, but these cost upwards of $2k, not within my budget, and they still require C++!
Have you considered just Using a DSN?
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane