Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: ODBC error when you use scalar functions to insert timestamp with fractional value


View products that this article applies to.

This article was previously published under Q259287

↑ Back to the top


Symptoms

When you use ODBC scalar functions with the Microsoft Jet 4.0 OLE DB provider to insert a timestamp that contains a fractional (millisecond) value, the Jet ODBC driver (Odbcjt32.dll) may return the following error message:
Return: SQL_ERROR=-1
[Microsoft][ODBC Microsoft Access Driver] Reserved error (|); there is no message for this error.
Note The Jet 3.51 ODBC driver allows the statement to succeed, and returns SQL_SUCCESS_WITH_INFO and a "Data truncated (timestamp)" message.

↑ Back to the top


Cause

The Jet OLE DB driver does not support storage of millisecond values.

↑ Back to the top


Resolution

To resolve this problem, install the latest Microsoft Jet 4.0 service pack. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
239114� How to obtain the latest service pack for the Microsoft Jet 4.0 Database Engine

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This problem was fixed in Jet 4.0 Service Pack 6 (SP6).

↑ Back to the top


More information

Scalar functions are inherent to ODBC, and are used when you need syntax or functionality that cannot be driver-specific. ODBC provides a large number of scalar functions for operations such as string conversion, date and time operations, mathematical functions, and so on.

In this circumstance, the error is generated when you use the ODBC scalar syntax to insert a timestamp that contains a fractional (millisecond) value. For example:
Insert into Table1 values (10, {ts '1999-09-02 12:12:12.121000'})
				
If you use the SQLBindParameter function instead of the scalar syntax, the statement succeeds, and returns SQL_SUCCESS_WITH_INFO and a fractional truncation message.

↑ Back to the top


Keywords: kbbug, kbfix, kbjet, kbmdac210sp2fix, kbmdac250fix, kbqfe, kbhotfixserver, KB259287

↑ Back to the top

Article Info
Article ID : 259287
Revision : 9
Created on : 7/31/2006
Published on : 7/31/2006
Exists online : False
Views : 385