views:

350

answers:

2

The scenario in question relates to the much-maligned Microsoft Jet database engine. The assertion was that the Data Access Objects (DAO) data access technology is 'native' to Jet, the implication being that creating an object via the DAO model is 'superior' to doing the same via SQL code executed from within in the Microsoft Access user interface.

Furthermore, it was asserted that if you couldn't create something via DAO then by definition it is not 'native' to Jet.

To me, this definition of 'native' seems to be misplaced. There are a number of Jet objects which, for historical and Microsoft political reasons, were omitted from or only partially implemented in DAO (CHECK constraints, fixed-width data types, the DECIMAL data type, compressible data types, etc) but were included in Jet's SQL data definition language (DDL). Intuition alone tells me that Jet SQL DDL should be considered 'native' to the Jet engine.

So my question is: why would a technology seemingly external (DAO) be considered 'native' and another technology seemingly internal (SQL DDL) be considered 'non-native'? Should I be troubling myself over whether something is 'native' or otherwise?

+1  A: 

Maybe I'm wrong here, but I always understood it like this:

  • the MS Jet database engine is by all means a database engine (underpowered or not)
  • it's "native" interface to the outside world is an SQL dialect

whereas:

  • DAO is one of Microsoft's database abstraction layers, designed for use in a COM environment like VBA or Windows scripting
  • it was developed with Access (which can be looked at as a user interface / reporting tool for MS Jet, since MS Jet can exist without MS Access), and is strongly bundled with both MS Jet and MS Access, nevertheless it is in the same category where ADO would be in
Tomalak
"MS Jet can't exist without MS Access" -- not at all true. Jet is installed on every version of Windows since 2000, whether or not Accedss is installed.
David-W-Fenton
@David W. Fenton: That's what I said. Look closer. ;-)
Tomalak
Well, what do you know -- yes, that *is* what you said. My bad!
David-W-Fenton
+1  A: 

This question is not really posted in good faith, in my opinion -- it's entirely directed at me and the comments I've been making in reponse to your comments. I've already answered all the issues elsewhere, but just to make things clear, let me outline the history of Jet.

Jet was introduced in the early 90s along with Access. Between version 1 and 2, MS acquired Foxpro and incorporated its "Rushmore" technology into Jet. Somewhere along this time frame, MS developed DAO as the interface layer to Jet. I don't know for a fact that DAO ever had an existence as anything other than a data interface layer that used Jet for all data access, but that's how it looked to me. Jet was a rather good choice for this since with ODBC and installable ISAMs, it could make just about any of the then-common database formats look and behave in your app in the same way native Jet data looked and behaved. Back in those days, the desktop database market was dominated by dBase and its variants and Paradox. These were all desktop db engines, not server databases. Access to server databases was generally through ODBC, but was not at that time all that important to desktop db application developers. Jet managed fairly well to connect to ODBC data sources and utilize them pretty efficiently, though it would sometimes make mistakes (and this is why ODBCDirect was introduced into Jet, which would bypass certain aspects of Jet's data processing engine).

Now, parallel to the rise of Access/Jet/DAO, Visual Basic was the hot product for generalized Windows app development and before the flourishing of the Web, VB was the most widely-used programming languages in the world. DAO and Jet provided VB developers with an interface to all sorts of data stores, and the VB development tools were well-integrated with them. Thus, after ODBC, DAO became MS's key data interface layer, utilizing the Jet engine to work with all kinds of data.

Naturally, this had its problems and was also very limiting in that Jet/DAO (and VB) were all desktop-oriented tools. By the mid-to-late 90s MS was attempting to expand from a provider of desktop softwares, desktop OS's and development tools to an enterprise software provider. So, MS needed to develop more robust data interfaces, something like ODBC for database servers, but with all the modern features that newer server databases offered. OLEDB was the answer for this with ADO as the interface layer on top of OLEDB (just as DAO is the interface layer on top of Jet). While the goal of DAO was to provide access to lots of data stores via the Jet database engine, OLEDB was a more neutral data interface layer like ODBC, a database abstraction layer, and ADO was the interface to that neutral data interface layer.

On the question of "native" DDL, it is a fact that before Jet 4 there was very poor support for SQL DDL. That is, there were features of Jet that were not controllable via SQL DDL. Instead, you had to use DAO to control those features. While the Jet Database Engine Programmer's certainly includes DDL examples alongside the DAO examples, the DAO examples are able to do a lot more because the Jet DDL SQL never supported all the features of Jet databases.

The breakdown that seems to be so confusing came about because of internal MS politics. By 1999, when MS introduced Access 2000 (with the new version of Jet, 4.0), MS wanted to retire DAO in favor of ADO. MS made ADO the default data interface layer in Access even when it made no sense to use ADO (i.e., your data store was Jet). As part of this effort, MS did not fully update DAO to incorporate support for all the new features of Jet 4 -- instead they put their efforts on this front into ADO. The result was that Jet's native data interface layer, DAO, lacked support for Jet features that the database neutral interface layer, ADO, offered. This was, in my opinion, a particular form of douchebaggery on Microsoft's part. MS was intentionally not updating Jet's native interface layer in order to force you into using the non-native interface. So, instead of DAO->Jet, you had to use ADO->OLEDB->Jet, even to for some things that were native aspects of the Jet database engine (such as some data types for fields).

Microsoft's goal was to kill off DAO entirely, and really, to kill off Jet itself. They wanted customers to move to SQL Server.

But a number of things happened. For one, ADO, which was COM-based, could not fit in very well with .NET, and therefore, classic COM-based ADO ended up being abandoned and ADO.NET created to take its place. The resemblences between ADO and ADO.NET are quite superficial and are based on completely different models of data interaction, with ADO.NET being almost entirely designed around the idea of disconnected data, while ADO was not (though it certainly supported certain kinds of disconnected data access).

With ADO going out the window, MS had a hole in the middle of its product line. The classic VB developer or Access developer was not going to see much benefit in .NET, because the whole data access model didn't fit. Thus, by the release of Access 2002, MS had reversed course and put DAO back in its place as the default data interface layer for Jet data (and all the other data stores Jet could work with via, e.g., ODBC, etc.). Unfortunately, while MS was now deprecating ADO for use with Jet, they didn't choose to fix the crippled version of DAO that went with it. Perhaps they didn't do this because by this point the decision had been made to fork the existing Jet 4 into a database engine owned by the Access development group. This eventually became the ACE and is, for all intents and purposes, Jet 4.5. A new version of DAO was released (though disguised a bit with its user-friendly name being "Microsoft Office 12.0 Access database engine Object Library" while the DLL name is now ACEDAO.DLL). I don't know the degree to which the features missing in DAO 3.6 (the Jet 4 version) have been added to the ACE version of DAO. I don't know because I don't need any of those features so don't even know what they are.

In any event, at this point, there is now ongoing development on Jet (we'd been promised that Jet 4 was the end) and on the data interface layer native to it (DAO, which we'd also been promised was dead). This ongoing development is now within the Access application group at Microsoft (as opposed to Windows, where Jet 4 was previously being maintained).

Microsoft has added compatibility modes in Access to use what they call ANSI-92 SQL mode. This is supposed to allow you to write SQL that is "compatible" with SQL Server's SQL dialect. Well, it supports a few things (you can use the SQL Server wildcards and use () for derived tables instead of Jet's screwy []. As Alias), but isn't very close to TSQL. But outside of Access, the only way to use this "ANSI-92" SQL mode is to use ADO to connect to Jet. DAO itself still uses Jet's old dialect of SQL. This shows that Jet is not providing support for this mode itself, but it's being provided by layers above Jet.

David-W-Fenton
That's a damned good history (slightly biased, natch). Thanks for taking time. But what I'm still wondering is... welll, basically, what I asked i.e. why is DAO 'native' and ANSI-92 SQL DDL 'non-native'? I get that OLEDB->Jet involves 'indirection' but so does DAO->Jet. When I use ANSI-92 SQL DDL via the Access interface, presumably it is interfacing with Jet's SQL parser, so why isn't this 'native'? And, as I originally asked, should I be troubling myself over whether something is 'native' or otherwise?
onedaywhen
I will resist the temptation to 'correct' your history but one thing you said: "support for all the new features of Jet 4...they put their efforts...into ADO" -- I think your emphasis on ADO is wrong. Rather, the effort went into SQL DLL and OLE DB. It's not that MS abandoned ADO specifically: more like they abandoned COM in general, however because they had put their efforts in to OLE DB, Jet was 'good to go' for .NET. Yes, ADO.NET has little to do with ADO classic: they kept the name for marketing reasons alone (A stood for 'ActiveX', being a COM technology!)
onedaywhen
On the SQL question, I'm not even sure if Jet is actually a SQL database or if the SQL is all handled at a level grafted on top of Jet. It would seem to me odd if Jet were really a SQL database and yet it then failed to define DDL to control all its features. More likely to me would be that SQL is incompletelly grafted on top of Jet in some way. This would explain why Jet's native interface (DAO) would support more than SQL, because DAO was dealing directly with Jet. But I really don't know the answer.
David-W-Fenton
You're leaving out layers. It's ADO->OLEDB->Jet vs. DAO->Jet. DAO and Jet were built together, with DAO being the programmatic interface for Jet and with nothing in between them. That's what I mean by native -- the purpose of DAO was to control Jet and at a low level. It was written as one-to-one representation of the features in Jet, something that was sadly lost when MS failed to update DAO3.6 to completely implement all the new features in Jet 4.
David-W-Fenton
In regards to your correction you're missing the key point that my history is about Jet and Access. Access is COM-based so the fact that classic ADO could not fit into non-COM-based technologies is orthagonal to the needs and priorities of Access users. The betrayal by MS was in pushing classic ADO on Access developers when it provided no actual advantage (the vast majority of Access apps use a Jet back end), and they actually crippled DAO in the process.
David-W-Fenton
"That's what I mean by native -- the purpose of DAO was to control Jet and at a low level" -- First, do you have a citation so I can research this further, please? Second, what does it matter if my SQL DDL uses an interface to flip a bit at the low level and your DAO code goes straight in an flips that bit itself? I mean, what's the big deal about this definition of 'native' I'm still not seeing?
onedaywhen
You're assuming that Jet is SQL-based at the lowest level. I'm not making that assumption. That is, when I send a SQL DDL statement, if Jet is not SQL-based, there's a layer above Jet that's translating that DDL statement into Jet's native commands for changing database structure. I don't know one way or the other, but the fact that common DDL commands are so poorly supported in early versions of Jet (pre-4.0) and that the only published book on the Jet db engine hardly mentions DDL at all suggests to me that Jet uses something other than SQL in its native engine.
David-W-Fenton
First, is the book you mentioned the citation I requested above? If so, more details please...
onedaywhen
Second: "You're assuming that Jet is SQL-based at the lowest level": certainly not! I doubt there has ever been a DBMS that uses SQL in its native engine. The whole point of SQL is to avoid having to get involved in low level code at the engine level. Look at an execution plan for a query in SQL Server: you'll see that at the engine level there is procedural code -- it even mentions loops! -- being the antithesis of SQL's set-based paradigm...
onedaywhen
But surely the same is true of DAO i.e. you are manipulating an object model that has been smartened up into a nice hierarchy of classes and collection classes so that you don't get involved with the probably not-so-nice low level code. So, again, what is the big deal about you calling a DAO dll to get to the low level and me calling a SQL parser to get to the same low level code?
onedaywhen
I don't know what book you cited -- "above" covers a lot of ground! What I meant was the only *Microsoft*-published book on the Jet database engine, "Microsoft Jet Database Engine Programmer's Guide" by Dan Haught and Jim Ferguson, of which I have the 2nd edition, published in 1997.
David-W-Fenton
There are different SQL parsers involved, obviously, depending on what interface you use. The whole reason for DAO's existence is to control the Jet database engine via a COM interface. It was the recommended method in the official MS documentation until the politics of ADO entered the picture in 1999 (with the release of Jet 4 and Access 2000). We're going round and round in circles here as I've said this repeatedly, and you seem unwilling to recognize the intimate connection between DAO and Jet (as opposed to DDL, which is not Jet-specific).
David-W-Fenton
I recognize DAO is *intimate* with Jet but it isn't actually Jet, is it? It may run native Jet code but DAO isn't native to Jet, right? Intimate does note equal native, agreed? But surely Jet syntax SQL DDL must be part of Jet, no? I mean, it cannot be run on any other SQL products because, for example, SQL Server doesn't know have WITH COMP in its syntax and will error. So if Jet SQL DDL syntax isn't part of Jet, and it isn't part of Access (but can be run from Access) and it isn't part of OLE DB (but it can be run via OLE DB) then where exactly does it exist in the Jet/Access world?
onedaywhen
I didn't say that SQL DDL is non-native. My point is that it was not implemented by MS as the principle interface for manipulating Jet data structures. If it had, it would have implemented all the features of Jet. Instead, manipulation of those features was implented in DAO. When ADO came along, as a neutral database interface, the drivers for Jet were implemented to manipulate more DDL commands than using Jet DDL without ADO. You get the extra DDL features by virtue of using a translation layer that is more versatile (though of course the Jet drivers had to implement those features).
David-W-Fenton
"I didn't say that SQL DDL is non-native" -- you did, here: "If ANSI-92 is native to Jet, why can't you use it with DAO? It's very clearly the case that ANSI-92 compatibility is provided at a layer above Jet, not within Jet itself." (http://stackoverflow.com/questions/766607/is-accesss-autonumber-increment-guaranteed-to-increment/769970#769970). You say "translation layer", I say "ACE/Jet SQL parser" but whatever it's called, do you agree it is 'part of Jet' and that being 'part of Jet' equates to being 'native'? If not, what does 'native' mean to you?
onedaywhen
FWIW I can only think of one Jet 'data structure' property that can be set via ADO but not via SQL DDL, being 'One BLOB per Page'. There are others but they either have very close SQL DDL equivalents (e.g. 'Allow zero length' and Validation Rules can be handled using CHECK constraints) or apply only to the Access UI ('Description', 'Hyperlink', etc) or non-Jet sources (e.g. 'IISAM Not Last Column'). So I think you must underestimate what SQL DDL can do nowadays.
onedaywhen
Some SQL DDL syntax is understood natively by whatever query parser Jet uses by default in Access and via DAO. Some additional DDL syntax is usable via ADO. What you quote me as having said is not relevant to what you are using it for, which is to try to demonstrate that I said "SQL DDL is non-native."
David-W-Fenton
@onedaywhen: "You say 'translation layer', I say 'ACE/Jet SQL parser' but whatever it's called, do you agree it is 'part of Jet' and that being 'part of Jet' equates to being 'native'?" I'm saying the "translation layer" is *not* part of Jet, that the translation layer is taking one syntax and converting it to something that Jet understands. That's the definition of non-native, i.e., needs translation.
David-W-Fenton
When you write "ADO" do you mean "DAO?" Secondly, an Access database is still a Jet database, and, thus, properties like the Description field are custom properties used by Access's brand of Jet MDBs. The inability to manipulate custom properties via DDL is the main point -- the custom properties are nonetheless Jet properties and they can only be manipulated via DAO, not via DDL.
David-W-Fenton
I'm done here. The discussion is no longer illuminating, but just repetitive. Perhaps I don't explain myself well, but it seems to me that you are not very attentive when you read what I write, because you seem to miss so many things that I've said and keep bringing up questions I've already answered.
David-W-Fenton
"SELECT * FROM MyTable" requires a 'translation layer' i.e. a SQL parser. If you saying this is non-native and not part of Jet then that is frankly ridiculous!
onedaywhen
I didn't say that, and you know it. That's why this discussion is over.
David-W-Fenton
"When you write 'ADO' do you mean 'DAO'?" No. I meant properties of the Jet database that only have relevance to the Access user interface and AFAIK the exhaustive list is 'Table Hidden in Access', 'Hyperlink' and 'Description'. Of those, AFAIK 'Table Hidden in Access' is not exposed to DAO.
onedaywhen
I've heard of Jet custom properties but I never seen them actually used and personally don't see the point (isn't that what *tables* are for?) Google for "Jet Property Manager" and you don't get many hits. Most telling is I've only ever seen JPM wheeled out in one of those "What DAO can do that ADO cannot" (and vice versa) debates, which isn't a fair fight because, as you point out, MS crippled DAO years ago ;-) So, while I don't think anyone really suffers from their absence from SQL DDL, fair point, they are indeed absent.
onedaywhen