Who writes these APIs anyway?


I have been faffing around for much of the evening with a simple wrapper class to invoke ODBC calls from a Lotus Notes application to a SQL Server 2005 Express database. The ODBC connection is registered and working, the database is happy, and so now it’s time for code:

Helpful error message courtesy of Lotus ODBC LSX

Well that’s helpful.

Trying to extract the actual error message via ResultSet.GetErrorMessage() doesn’t do much. I either get the error above, or NO ERROR. All I’m doing is retrieving a ResultSet (a few table rows) and then attempting to add a new row. The code consistently fails on the final ResultSet.UpdateRow call. The AddRow calls are fine. The user account has owner privileges against the table in question, the SQL is valid and works when applied directly to the database, and so on. I’m going to lose the last of my hair soon. This stuff is supposed to be easy and Lord knows I’ve done it enough times with other databases. Maybe the ODBC LSX doesn’t like SQL Server Express 2005? Who knows?

Update #1: tsk, you want something doing properly, do it yourself: INSERTing raw SQL instead of relying on LS:DO’s abstractions seemed to do the trick.

Update #2: Nothing like Stanley Clarke’s Life Is Just A Game as a way of getting a sense of urgency into your coding. :-)


  1. I made the experience, that it is better to use the OLEDB connector when using SQLServer. Works faster, is more stable and doesn't throw that much errors… And passthru SQL works too.Stephan H. Wissel#
  2. I avoid ODBC wherever I can. Unfortunately I run Domino on Linux and I don't have another option in server-based agents.Charles Robinson#
  3. Hi Ben,

    I was going to suggest trying OLEDB instead of ODBC but Stephan beat me to it.

    RobRob Wills#

Comments on this post are now closed.


I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.