Article ID: 284843 - Last Review: January 29, 2007 - Revision: 3.1 FP2002: Error Querying Date/Time Fields in Access DatabasesThis article was previously published under Q284843 For a Microsoft FrontPage 2000 version of this article, see 296653 (http://support.microsoft.com/kb/296653/EN-US/ ) . SYMPTOMS
When you attempt to search a Microsoft Access database using a date/time field, the following error message appears:
Database Results Error Description: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. Number: -2147217913 (0x80040E07) Source: Microsoft OLE DB Provider for ODBC Drivers CAUSE
The code in the Database Results Wizard or the Database Interface Wizard that is generated by FrontPage, does not support querying a date/time data type in an Access database.
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To work around this behavior and query the date/time field in an Access database, generate the database results region and then modify the code to pass a date/time value. You will need to change the apostrophes to number signs in the SQL SELECT statement. To do this, follow these steps. NOTE: The following procedure demonstrates how to do this by using the Employees table in the Northwind database. You will need to substitute your database, table, and code for that shown in this procedure.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
| Article Translations
|
Back to the top
