LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database Erorr -2147217900 ID field

Solved!
Go to solution

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.lvlib:DB 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

0 Kudos
Message 1 of 7
(3,601 Views)

Audra wrote:

Any idea on how to get around this?


idea

0 Kudos
Message 2 of 7
(3,597 Views)
I have checked out those posts but the nameing is not the problem.
0 Kudos
Message 3 of 7
(3,594 Views)
I don't understand why you think you have to include the id field in your insert.
0 Kudos
Message 4 of 7
(3,582 Views)
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.
0 Kudos
Message 5 of 7
(3,579 Views)

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.

0 Kudos
Message 6 of 7
(3,576 Views)
Solution
Accepted by topic author Audra
I got the database to work. I had to delete a column then input the info. Thanks for the help
Message 7 of 7
(3,567 Views)