Microsoft KB Archive/223198

= ACC2000: Error Message When Inserting Null Value into a TimeStamp Field of a SQL Server Table =

Article ID: 223198

Article Last Modified on 1/26/2005

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q223198





This article applies only to a Microsoft Access database (.mdb).

Advanced: Requires expert coding, interoperability, and multiuser skills.



SYMPTOMS
When you try to insert a Null into a TimeStamp field on SQL Server, you may receive the following error message:

ODBC--call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]The user can't INSERT a non-null value into a TIMESTAMP column. Use INSERT with a column list or with a default of NULL for the TIMESTAMP column. (#273)



CAUSE
The Use ANSI nulls check box is selected (checked).



RESOLUTION
When creating the Data Source Name (DSN), make sure the Use ANSI nulls check box is not selected (is unchecked).



STATUS
This problem no longer occurs with Microsoft SQL Server 7.0.



MORE INFORMATION
This error can occur when you use Microsoft Access 2000 to pass queries to Microsoft SQL Server 6.5.

Steps to Reproduce Problem
 Create a new DSN called TestTimeStamp that points to the Pubs database on your SQL Server 6.5 computer. Open a new, blank database. Create a new query. Click Close in the Show Table dialog box.</li> On the Query menu, point to SQL specific, and then click Pass-Through (this establishes the new query as a pass-through query).</li> On the View menu, click Properties to open the Query Properties window.</li>  In the ODBCConnectStr property, enter the following.

Note In the following sample code, you must change UID=  and PWD=  to the correct values. Make sure that the user ID has the appropriate permissions to perform this operation on the database. <pre class="fixed_text">  ODBC;DSN=TestTimeStamp;UID= ;PWD= ;Database=Pubs </li>  Type the following into the SQL Pass-Through Query window: <pre class="fixed_text">  Create table t_TimeStamp (col1 timestamp) </li> On the Query menu, click Run.</li>  Click OK when you get a message similar to: <pre class="fixed_text">   Pass-through query with ReturnRecords property set to True did not return any records. </li>  Replace the SQL statement that is in the SQL Pass-Through Query window with the following: <pre class="fixed_text">   Insert into t_TimeStamp values (NULL) </li> On the Query menu, click Run, and then click OK when you get a message similar to the following:

ODBC--call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]The user can't INSERT a non-null value into a TIMESTAMP column. Use INSERT with a column list or with a default of NULL for the TIMESTAMP column. (#273)

</li></ol>

Additional query words: pra can t

Keywords: kbbug kbpending KB223198

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.