|
|
8000XXXX Errors ASP.NET 2.0 Classic ASP 1.0 Databases General Concepts Search Engine Optimization (SEO)Search | ASP FAQ Tutorials :: 8000XXXX Errors :: NZ() function and 80040E14 errors Can I use the NZ() function without getting 80040E14 errors?VBScript doesn't support the NZ() function. But here is a custom implementation, and a demonstration of its use:
A more common place you would expect to use NZ(), however, is returning the results of an Access query. You will find that if you try to use NZ() and call the query from an ASP page, you'll get this error:
Let's say you have a numeric column, and want it to return 0 instead of NULL for all records that are NULL. In Access, you would say:
Since you can't use NZ() from ODBC/OLE-DB, you can use IIF instead:
Or you can try IFNULL if you are going through ODBC, e.g.
If you are porting this code to SQL Server, you would use slightly different syntax:
or
(I prefer the COALESCE expression, which accepts multiple successive arguments. So you could say COALESCE(col1, col2, col3, ...) and it would return the *first* column that is NOT NULL.) Of course if NULL means the same thing as 0, you should consider running this query:
For more information on preventing NULLs from entering your ASP page, or avoiding NULLs in your data altogether, see Article 2150 and Article #2073. Related Articles Why 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 80040E21 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? 80004005 Errors |