Why do I get 80040E21 errors?
This can happen if you use an adOpenStatic ADODB.Recordset object to open Excel, or use an adOpenKeyset recordset to perform paging,
Basically, make sure the methods/properties you are using are supported by the driver/provider you are using to access your data.
If you are executing a stored procedure, make sure you do so through the connection.execute() method, rather than a command object, and add the following two lines of code to the beginning of your procedure:
If you are using With, an ADODB.Recordset, and the AddNew/Update methodology, consider not doing so (see Article #2191) and, failing that, see KB #228935.
If you are sure that these things are intact, make sure you have the latest version of MDAC (MDAC Download Page).
This can often be caused by using invalid ad* constants with ADODB.Command, such as adDBDate. Use adDBTimeStamp instead (see KB #214459) or, better yet, use a straight EXEC statement instead of using the command object at all (see Article #2201).
This error is pretty explanatory. Access does not allow these 'special' columns to be included in DISTINCT queries. So if you have the following code, where bar is a memo column:
You could change it to the following to alleviate the error:
Though I have always questioned why you would have duplicates in a memo column; since it is designed to store a LOT of text, it seems that in most scenarios it would be unlikely to repeat enough, and also be insignificant in terms of individual records?
This can happen if you try and pass a NULL string or a non-string datatype to an ADODB.Recordset object or a stored procedure, and the database logic attempts to perform an implict or explicit CONVERT or CAST.
If you are using an aggregate function (e.g. SUM, COUNT, MAX), then any other column in the SELECT list must also be in the GROUP BY clause. This is so that the database knows how to organize results.
For full information on this error message, see Article #2288.
Related ArticlesWhy do I get 8002000A errors?
Why do I get 80040200 / 80040514 / 800A0E7A errors?
Why do I get 80040e09 errors?
Why do I get 80040E0C errors?
Why do I get 80040E10 errors?
Why do I get 80040E14 errors?
Why do I get 80040E23 errors?
Why do I get 80040E24 errors?
Why do I get 80040E2F errors?
Why do I get 80040e30 errors?
Why do I get 80040E31 errors?
Why do I get 80040E37 errors?
Why do I get 80040e4e errors?
Why do I get 80040E54 errors?
Why do I get 80040E57 / 80040E07 errors?
Why do I get 8004D00A errors?
Why do I get 80070070 errors?
Why do I get 800A01FB errors?
Why do I get 800A0BB9 / 800A1391 errors?
Why do I get 800A0C93 errors?
Why do I get 800a0cb3 errors?
Why do I get 800A0CC1 errors?
Why do I get 800A0E78 errors?
Why do I get 800A0E7C errors?
Why do I get 800A0E7D errors?
Can I use the NZ() function without getting 80040E14 errors?