cancel
Showing results for 
Search instead for 
Did you mean: 

Database Erorr -2147217900 ID field

SOLVED
Audra
Member
Solved!

Database Erorr -2147217900 ID field

I am new at databases. I have figured out how to talk and write but now I have a new problem. I have an ID field in the SQL database that populates automatically. It shows up on the columns therefore I have to include the field on the write. But everytime I include the ID field I get this error

 

Possible reason(s):
Exception occured in Microsoft OLE DB Provider for SQL Server: Cannot insert explicit value for identity column in table 'data' when IDENTITY_INSERT is set to OFF. in NI_Database_API.lvlib:Rec Create - Command.vi->NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlibSmiley Very HappyB Tools Insert Data.vi->TS114Print.vi

 

Any idea on how to get around this? Most of the posting deal with invalid characters in the names I am sure that is not the case.

 

Please help

6 REPLIES 6
Mathan
Trusted Enthusiast

Re: Database Erorr -2147217900 ID field

Message contains a hyperlink

Audra wrote:

Any idea on how to get around this?


idea

Audra
Member

Re: Database Erorr -2147217900 ID field

I have checked out those posts but the nameing is not the problem.
Dennis_Knutson
Knight of NI

Re: Database Erorr -2147217900 ID field

I don't understand why you think you have to include the id field in your insert.
Audra
Member

Re: Database Erorr -2147217900 ID field

If I don't include the id field I get this error -1. The only way I have found to get away from error -1 is to include all the columns in the data. The ID field shows up in the column read.
Dennis_Knutson
Knight of NI

Re: Database Erorr -2147217900 ID field

I don't use the toolkit and probably never will but you can certainly do an INSERT INTO command without using an id column. Use the lower level DB Tools Execute Query.

Audra
Member
Solution

Re: Database Erorr -2147217900 ID field

I got the database to work. I had to delete a column then input the info. Thanks for the help