Tony Davis

Simple-Talk Editor
News, views and good brews

Reckless Drivers

Published Thursday, January 07, 2010 11:53 AM

When I first joined the industry in the late 90's, Microsoft was in the process of shunting the ODBC driver into the background in favour of OLE-DB and ADO. The ODBC driver was still included in Microsoft' Windows MDAC framework, but it had gained a rather unfair reputation for obtuse connections strings, unreliability and slow data access. They had to include ODBC, as it was and remains, the only way to connect to the more exotic data sources.

Most VB/ASP developers adopted ADO and OLEDB, as they were promised enhanced performance. The connection strings were hardly any less obtuse but developers persevered. Lucky .NET programmers are now provided with ADO.NET, which is the central database access machinery and allows you to connect with SQL Server via OLEDB, SQLClient, or ODBC.

However, things are more confusing for those stuck with unmanaged applications. When SQL Server 2005 appeared, Microsoft chose not to update MDAC to support the new features and data types. Instead, they introduced SQL Native client (SQLNCLI), offering combined ODBC and OLEDB functionality in a single DLL and included support for all the new data types – UDTs, XML, varchar(max) – as well as snapshot isolation, Multiple Active Result Sets, and so on. Any stuffy old unmanaged ADO /MDAC apps that didn't need access to these exciting new features could continue to use MDAC, which Microsoft hurriedly renamed to 'Windows DAC'; otherwise the apps had to be migrated to the SQL Server Native Client.

It does seem that the native client is more powerful and reliable than the MDAC ones, which had a tendency to "break" an application every time a new Windows service pack was applied. Unfortunately, those brave souls who chose to move from MDAC to the native client, in order to exploit the new features of SQL Server entered a minefield. While MDAC was tolerant of less than strict adherence to the specs (such as starting parameter names with "@"), the native client isn't, and will issue errors. There are also all sorts of subtle variations in behaviour to deal with, in regard to connection strings, dealing with failed connections, warning and error handling, and even in basic transaction handling. And it isn't as if the support for new features is complete. Yes, the native client supports the xml data types, and FOR XML queries…but that's it. No other part of XML is supported by the native client. You have to use SQLXML for this.

How did we find ourselves in this mess on an issue as fundamental as database connectivity? Ten years ago Microsoft lost enthusiasm for the ODBC standard, and it is left mainly to "sticks in the mud" like Phil Factor to point out that what we dismissed was actually worth having: a fast, truly open standard for accessing all data sources. If it had been properly nurtured and developed by Microsoft so that it supported the full standard, it would doubtless have been loved by all.

Instead new drivers come and go, along with new standards for data access, such as LINQ and EF, so that people are left paralyzed by choice, and unable even to safely upgrade their applications to support the newest version of the database.

Cheers,

Tony.

Comments

 

nislm said:

Good one!
January 7, 2010 12:56 PM
 

SkyBeaver said:

My experience with SQL Server connectivity goes all the way back to version 4.2 of SQL Server.  Up until 1996, Microsoft actually didn't write any of the code for SQL Server.  It was actually developed by Sybase, a company that today is more of  niche player in the database market.

The original API to SQL Server was somethng called DB-Library, which was actually very easy to program with although it had the unfortunate trait of being single-threaded.  In the early days of SQL Server, ODBC was wrtten as simply a DLL on top of DB-Library.  The Sybase and Microsoft implementations of DB-Library were identical, except all the constant definitions began with SYBxxx in the Sybase implementation ad SQLxxx in the Microsoft one.

Sybase and Microsoft "divorced" in 1996 and both companies subsequently  released new APIs.   Microsoft implemented ODBC as a "native" driver, bypassing the requirement to have DB-Library installed.  This was actually pretty advanced in te day, considering that meanwhile Oracle, Informix, Ingres, and Db2 all were still using a very mainframe-esque API called Embedded SQL.

I think several big things have happened these days that fundamentally changed the nature of the problem.

1.  Java came along.  JDBC was a common language and an API that everyone understood.  It became the "lingua franca" for at least half of the development world.

2.  The business of selling development tools effectively ceased to exist.  Remember PowerBuilder, Borland Delphi, Information Builders, Uniface, Unify?  There used to be tons of development tools all competing for the corporate developer marketplace.  That market ceased to exist, its demise hastened by Java, HTML, VB, and the internet.  Along with it died a lot of the unique connectivity requirements that were out there.

3.  The number of data sources really shrank. There used to be a lot of database vendors out there.  I still remember, back in the early 1990s, when people used to refer to the "Big 5":  Oracle, Informix, Unify, Sybase, Ingres.  We're really down to 2 major databases as this point, Oracle and SQL Server.


Microsoft has made extraordinary strides with SQL Server connectivity, in my opinion, at least if you're a .NET developer.   ADO.NET is really a joy to develop with, as is LINQ to SQL.

However, just try getting a Unix-based application to connect to SQL Server.  You're faced with one of two unappealing choices:  use some mediocre, unreliable shareware library like FreeTDS, or pay thousands of dollars for a commercial Unix-based ODBC driver like DataDirect.  

.NETconnectivity to Oracle is very bit as performant and reliable as it is to SQL Server.  And yet, Linux and Unix-resident applications, of which there are many, still have only mediocre connectivity to SQL Server.  
January 10, 2010 10:43 PM
 

randyvol said:

Tony -

While I agree with the points you make, I find myself in the unusual position of defending Microsoft on this one to a degree...

As a database developer, I pine for a steady-state platform that never changes and hence, never breaks my code.  But that also means my database platform gets old and stale as new technology that might break things is not injected.

I find that the very thing that makes me more and more of an SQL Server advocate is also the thing that, if not managed well, can cause all kinds of headaches.
I refer here to the multitude of 'wrap arounds' that Microsoft provides with its database engine - SSAS, SSIS, SSRS, drivers and .Net support along with the plethora of alphabet soup products - ADO, MDAC, LINQ, etc.

So for me the problem is larger than just drivers.  The driver issue you raise is important and valid, but is one small part of a larger product-puzzle.

While all of these wrap-arounds put Microsoft at a distinct advantage (IMHO) over alternatives such as ORACLE, DB2, Teradata et al.  

They also require careful management by both customers and the vendor.
What become necessary for the customer when using SQL Server is to thing long and hard about what strategic technology choices should be made - pick them and live with them.  The temptation to use every new thing from Microsoft should be strictly controlled.

What is necessary for Microsoft to manage is a careful streaming of these new features into the market and this is where I think they are starting to lose perspective.  I fear I see the Microsoft Office "we need more revenue" model creeping into the SQL Server product roadmap.  Product Managers at Microsoft need to keep a reign on this.  Applications built on databases and dependent on databases tend to be large, strategic applications and are not prone to easily being 'migrated' simply because a vendor wants to move everything forward product-wise.

My gut tells me the 2010 product roadmap from Microsoft is going to be problematic for both them and their customers - too many things being shoved at the base at one time.  SS2K8 was problematic for us, I fear SS2K8 R2 is going to be even more problematic; the more I read about it, the more it comes across as a marketing driven release full of 'gotchas' for anyone wanting to try out the 'compelling' new features.  I find myself becoming more and more disposed to simply skipping the release altogether as I find out more about it.

An aside here to Microsoft - Office and Sharepoint are not going to become every unit items, especially at the prices being charged, so get over it and quit trying to architect everything to force the customer to purchase them.  If you don't you may find that people start looking for alternatives.
January 11, 2010 7:20 AM
 

sciszewski said:

You can't really blame MS for not wasting resources on a shrinking need. Although, here's an idea. Open source the set of ODBC drivers and let the interested community take care of it.
January 11, 2010 3:44 PM
 

starmatrix said:

This Visual Studio magazine article suggests Microsoft is taking a new interest in ODBC.  I think that may be a bit of a stretch.  Seems more like maintenance for continued compatibility.

The Return of ODBC: Boom or Bust?
http://visualstudiomagazine.com/blogs/data-driver/2009/03/the-return-of-odbc-boom-or-bust.aspx?sc_lang=en
January 12, 2010 9:38 AM
 

randyvol said:

Just a post to say a big 'thank you' for the $50 certificate on amazon.com; it will immediately be put to good use!

Thanks again.
randyvol
February 4, 2010 6:44 AM
You need to sign in to comment on this blog


















<January 2010>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
Microsoft Office Communications Server 2007 R2 – Part II
  Once you have set up Office Communication Server 2007 R2 to provide IM within the rganisation, the... Read more...

Mission Critical: Database Design
 There is nothing like a checklist to make sure you've completed all the tasks in designing a database,... Read more...

SQL Server Intellisense VS. Red Gate SQL Prompt
 Fabiano Amorim is hooked on today's Integrated Development Environments with built-in Intellisense, so... Read more...

Doug Crockford: Geek of the Week
  Doug Crockford is the man behind JavaScript Object Notation (JSON). He is a well-known critic of XML... Read more...

Raw Materials: Mirror, Mirror, on the Desk
 Seeing ourselves as we see ourselves. Read more...