what the heck does this mean?

J

James

I know these type of questions are lame but I am lame at access...ha...so if
I could understand what this error is telling me maybe I could find the
problem. Any help would be great thanks!

ODBC --call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value
for identity column in table 'table1' when IDENTITY_INSERT is set to OFF.
(#544)

ps. table1 is a subform with in a mainform
thanks
 
J

John Spencer MVP

It means that you are trying to insert a specific value into an identity
column (think autonumber) and SQL SERVER won't permit it unless
Identity_Insert Property is set to OFF. While the property is On (TRUE) only
the SERVER can insert values (that are aut0generated) into the field.

It sounds like you have a field in Table 1 that should be a foreign key to a
field on the main form.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
L

Larry Linson

James said:
I know these type of questions are lame but I am lame at access...ha...so
if
I could understand what this error is telling me maybe I could find the
problem. Any help would be great thanks!

ODBC --call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value
for identity column in table 'table1' when IDENTITY_INSERT is set to OFF.
(#544)

An "identity column" in SQL Server is similar to an Autonumber column in the
default Access Jet/ACE database engines, that is, SQL Server assigns the
value. The message indicates that you performed an operation that attempted
to set the value of the identity column in "table1" instead of letting SQL
Server set it. The problem could be in your definition of the table1 in SQL
Server, or in what you are doing in your database application. Only careful
examination and debugging on your part will determine which.
ps. table1 is a subform with in a mainform

I seriously doubt that "table1" is a "subform within a mainform". Even if
you used the name "table" for a "form", the message you received applies
only to tables, that is, tables in the server database. Tables are not forms
nor subforms; tables contain data; forms display data; subform controls
display other forms or datasheet views.




__________ Information from ESET Smart Security, version of virus signature database 4057 (20090506) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
D

David W. Fenton

James said:
I know these type of questions are lame but I am lame at
access...ha...so if
I could understand what this error is telling me maybe I could
find the problem. Any help would be great thanks!

ODBC --call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert
explicit value
for identity column in table 'table1' when IDENTITY_INSERT is
set to OFF. (#544)

An "identity column" in SQL Server is similar to an Autonumber
column in the default Access Jet/ACE database engines, that is,
SQL Server assigns the value. The message indicates that you
performed an operation that attempted to set the value of the
identity column in "table1" instead of letting SQL Server set it.

I don't think so, Larry. Only one table at a time can have
IDENTITY_INSERT on. Before an insert you have to set it OFF for
whatever table it's on for, and on for the table you're using. This
is best done by having your inserts be handled with stored
procedures.
 
R

Richard

http://support.microsoft.com/default.aspx/kb/160762


Richard

David W. Fenton said:
James said:
I know these type of questions are lame but I am lame at
access...ha...so if
I could understand what this error is telling me maybe I could
find the problem. Any help would be great thanks!

ODBC --call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert
explicit value
for identity column in table 'table1' when IDENTITY_INSERT is
set to OFF. (#544)

An "identity column" in SQL Server is similar to an Autonumber
column in the default Access Jet/ACE database engines, that is,
SQL Server assigns the value. The message indicates that you
performed an operation that attempted to set the value of the
identity column in "table1" instead of letting SQL Server set it.

I don't think so, Larry. Only one table at a time can have
IDENTITY_INSERT on. Before an insert you have to set it OFF for
whatever table it's on for, and on for the table you're using. This
is best done by having your inserts be handled with stored
procedures.
 
J

James

I seriously doubt that "table1" is a "subform within a mainform". Even if
you used the name "table" for a "form", the message you received applies
only to tables, that is, tables in the server database. Tables are not forms
nor subforms; tables contain data; forms display data; subform controls
display other forms or datasheet views.

Correct. I was thinking form, but typed table. sorry for the confusion.
 
D

David W. Fenton

I don't think so, Larry. Only one table at a time can have
IDENTITY_INSERT on. Before an insert you have to set it OFF for
whatever table it's on for, and on for the table you're using.
This is best done by having your inserts be handled with stored
procedures.

Yes, that was a completely brain fart on my part. I ended up very
confused over the subject.
 
J

James

Before an insert you have to set it OFF for
whatever table it's on for, and on for the table you're using. This
is best done by having your inserts be handled with stored
procedures.

how do I turn IDENTITY_INSERT on or off? I looked in the properties and
couldn't find it. thanks
 
L

Larry Linson

James said:
how do I turn IDENTITY_INSERT on or off? I
looked in the properties and couldn't find it. thanks

It's not an Access property. Did you look in the properties in the Server
DB?

Larry Linson
Microsoft Office Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top