adOpenStatic Logo
Navigation
Home
FAQ
Ken's Blog
Resources
Contact Ken
Copyright 2000 -



The 0x80040e10 error is thrown up by the JET OLEDB Provider. The underlying error message is:

No value given for one or more required parameters

The actual error message displayed on the screen will vary depending on which MDAC you have installed, eg for MDAC v2.5:

Microsoft JET Database Engine (0x80040e10)
No value given for one or more required parameters.

   - OR (for earlier MDACs) -

Microsoft JET Database Engine (0x80040e10)
Too few parameters. Expected 1.

There are three common scenarios:

Scenario 1 - Not enough parameters
If you fail to pass enough parameters to the database engine then you will get this error. This typically occurs when you use the WHERE keyword, but don't specify a condition. Eg:

<%
strVar = ""
strSQL = _
   "SELECT field1, field2, field3 " & _
   "FROM table1 " & _
   "WHERE field1 = " & strVar

objConn.Execute strSQL, , adCmdText
%>

Because strVar has no value the SQL string will contain:

WHERE field1 =

This then causes the error. This error is commonly encountered when the WHERE clause depends on data being submitted from the previous page by the client but the data doesn't arrive (eg because the user didn't fill in a field on a form on the previous page).

Scenario 2 - Misspelt column names
This error can be caused because your SQL statement refers to a field that doesn't exist in the database (eg because you misspelt it). Eg:

strSQL = _
   "SELECT EmploeyeID " ' Spelling error here & _
   "FROM Employees " & _
   "WHERE EmployeeID = 1"

Because EmployeeID is spelt incorrectly an 0x80040e10 error will result. This is covered in Microsoft's KB article Q216425.

Scenario 3 - Incorrect delimiters in SELECT queries
When using an SQL SELECT query the correct delimiter needs to be used for any parameters that you are using. You specify parameters in the WHERE clause of the SELECT statement. For example in the statement:

strSQL = strSQL & "WHERE EmployeeID = " & intID & " "

intID is a parameter. The value of intID will need to be enclosed with delimiters depending on what type of field EmployeeID is (see table below):

Field Type (Access)

Field Type (SQL Server)

Delimiter

Text

Char, varChar

'

Numeric

Any numeric type

<none>

Date/Time

Any Date/Time

# (Access), ' (SQL Server)

A sample query in Access that uses all these field types would look like:

SELECT field1, field2, field3
FROM table1
WHERE someTextField = 'somevalue'
AND someNumericField = 5
AND someDateField = #2001/12/31#

Back to FAQ Listing | Homepage