473,508 Members | 2,206 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nz() function and JET Database Engine (0x80040E14)

aa
I have beem recommended to use the Nz() function in the ORDER BY part of an
Access2000 stored query.

The query runs correcly from within Access2000
Yet when ran from ASP, it causes an error:

Microsoft JET Database Engine (0x80040E14)
Undefined function 'Nz' in expression.

Where should I define this function?
Jul 19 '05 #1
7 9296
aa wrote:
I have beem recommended to use the Nz() function in the ORDER BY part
of an Access2000 stored query.

The query runs correcly from within Access2000
Yet when ran from ASP, it causes an error:

Microsoft JET Database Engine (0x80040E14)
Undefined function 'Nz' in expression.

Where should I define this function?


There are quite a few Access/VBA functions that can only be used when Access
itself is running. Nz() is one of them. See here for the list of functions
that can be used from external applications (VB, ASP, etc):
http://support.microsoft.com/default...98&Product=acc

Note that the article shows you how to allow the functions to be used, but
this is not recommended from a security standpoint.

Instead of Nz, you can use IIF:

iif(isnull([fieldname], <default value>, [fieldname])

I just noticed an update to this article: Jet SP7 will allow user-defined
functions to be used! If I was still using Access in my applications, I
would be elated.

HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
http://www.aspfaq.com/2394
(Someone remind me later to update that article with the information that
Bob posted...)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"aa" <aa@virgin.net> wrote in message
news:eH**************@TK2MSFTNGP12.phx.gbl...
I have beem recommended to use the Nz() function in the ORDER BY part of an Access2000 stored query.

The query runs correcly from within Access2000
Yet when ran from ASP, it causes an error:

Microsoft JET Database Engine (0x80040E14)
Undefined function 'Nz' in expression.

Where should I define this function?

Jul 19 '05 #3
"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:uC**************@TK2MSFTNGP11.phx.gbl...
aa wrote:
I have beem recommended to use the Nz() function in the ORDER BY part of an Access2000 stored query.

The query runs correcly from within Access2000
Yet when ran from ASP, it causes an error:

Microsoft JET Database Engine (0x80040E14)
Undefined function 'Nz' in expression.

Where should I define this function?
There are quite a few Access/VBA functions that can only be used when

Access itself is running. Nz() is one of them. See here for the list of functions that can be used from external applications (VB, ASP, etc):
http://support.microsoft.com/default...98&Product=acc
Note that the article shows you how to allow the functions to be used, but this is not recommended from a security standpoint.

Instead of Nz, you can use IIF:

iif(isnull([fieldname], <default value>, [fieldname])

I just noticed an update to this article: Jet SP7 will allow user-defined functions to be used! If I was still using Access in my applications, I would be elated.


It sounded too good to be true, so I had to go see for myself. Here's
what I did:

1. Installed Jet 4.0 SP8 (4.0.8015.0)

2. Created the following module:

[modHelloWorld]
Option Compare Database

Public Function HelloWorld()
HelloWorld = "Hello World!"
End Function

3. Created the following query:

[qryHelloWorld]
SELECT HelloWorld() AS retVal;

4. Ran the following ASP code:
<%
Dim cn,rs
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.Open "<Your DSNLess OLEDB Connection String Here>"
cn.qryHelloWorld rs
Response.Write rs(0)
rs.Close : Set rs = Nothing
cn.Close : Set cn = Nothing
%>

No joy. I still get:
Microsoft JET Database Engine (0x80040E14)
Undefined function 'HelloWorld' in expression.

Note, I also changed my registry settings to completely disable
sandboxing per the referenced article. Same results.

Here's my environment:
Windows 2000 Professional (sp3)
Internet Information Server (5.0)
Active Server Pages (3.0)
VBScript (5.6)
MS Jet (04.00.0000)
Microsoft Data Access Components (2.80)
Microsoft OLE DB Provider for Jet (04.00.8015)
OLE DB (02.10)

Has anyone else had success using UDFs with Jet 4.0 sp7 or above?

-Chris Hohmann
Jul 19 '05 #4
Chris Hohmann wrote:
"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
http://support.microsoft.com/default...98&Product=acc

Note that the article shows you how to allow the functions to be
used, but this is not recommended from a security standpoint.

Instead of Nz, you can use IIF:

iif(isnull([fieldname], <default value>, [fieldname])

I just noticed an update to this article: Jet SP7 will allow
user-defined functions to be used! If I was still using Access in my
applications, I
would be elated.


It sounded too good to be true, so I had to go see for myself. Here's
what I did:

1. Installed Jet 4.0 SP8 (4.0.8015.0)


No joy. I still get:
Microsoft JET Database Engine (0x80040E14)
Undefined function 'HelloWorld' in expression.

Darn!

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #5
Thank you everybody.

Both Nz() and IIF came as a complete news for me.
I use "Mastering SQL" my Martin Gruber as a reference. It is 1.5 inches
thick and I failed to find any mentioning of Nz or IIF there
Are they part of standard SQL?
Could anybody provide a link I can read about them?

"aa" <aa@virgin.net> wrote in message
news:eH**************@TK2MSFTNGP12.phx.gbl...
I have beem recommended to use the Nz() function in the ORDER BY part of an Access2000 stored query.

The query runs correcly from within Access2000
Yet when ran from ASP, it causes an error:

Microsoft JET Database Engine (0x80040E14)
Undefined function 'Nz' in expression.

Where should I define this function?

Jul 19 '05 #6
> thick and I failed to find any mentioning of Nz or IIF there
Are they part of standard SQL?
No, they are bastardized VBA/SQL hybrid.
Could anybody provide a link I can read about them?


Access has online help...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #7
Thanks.
It did work for me
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1843
by: Sérgio Almeida | last post by:
Greetings I'm having problems adding records to an access database. What I want to do is very simple. Here is my code. __CODE_START__ dim sqlStatement sqlStatement="insert into...
2
6621
by: Pink Panther | last post by:
Using the following SQL can the results be explained? Using A97 (with the SP2 for Jet 3.5) or A2002 CREATE TABLE Test (PK Number CONSTRAINT PK_TEST PRIMARY KEY, ParentID Number, Child...
4
3004
by: MX1 | last post by:
Help. I have a complex Access database that I've tied into using ASP. Things work great, except I can't seem to have queries that originate in ASP use the NZ function. Need it in case there are...
42
2178
by: lylefair | last post by:
The file is now available as http://www.ffdba.com/downloads/testingNZ3.dat (rename .dat to .mdb) or http://www.ffdba.com/downloads/testingNZ3.mdb (At time of posting I have not opened the file.)
4
7675
by: Paul | last post by:
Anyone have code that emulates the Nz function in Microsoft Access? In Access it is: Nz(Value as variant, Optional ValueIfNull as Variant) as Variant
2
5271
by: lnd | last post by:
This was probably asked n-times but still: Is there any way to end (commit/rollback) a transaction inside a stored function? (The reason why it is good to commit/rollback in a stored procedure...
1
1164
by: shamlafazal | last post by:
When i use Send Form Results to a Database and an E-mail Address and Use the File Upload Component Simultaneously , am getting an error mentioned below. Please any can help me on this. "Database...
2
1348
blyxx86
by: blyxx86 | last post by:
Hey everyone, I've finally overcome a plethora of development hurdles!! I think my database is ready for usage. Now the only problem I am facing is getting some of my queries to display the proper...
3
5077
by: Alain Bourgeois | last post by:
Dear all, I have an asp module connecting to a MS-access database. I have a vb function MKDate(date, time) in a vba module of this database. I would like to query : SELECT MKDATE(col1,...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.