Connecting Tech Pros Worldwide Forums | Help | Site Map

ODBC--call failed.

Newbie
 
Join Date: Jul 2008
Posts: 1
#1: Jul 24 '08
Recently our database team member left and we have had this issue come up which I am trying to understand. The error is below, it comes up when we try to add a project entry under our Order Entry and ask for the Order Status.



ODBC--call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint 'blah'. Cannot insert duplicate key in object 'alsoblah'. (#2627) The statement has been terminated. [Microsoft][ODBC SQL Server Driver][SQL Server] (#3621)

Delerna's Avatar
Expert
 
Join Date: Jan 2008
Location: Sydney
Posts: 790
#2: Jul 25 '08

re: ODBC--call failed.


That error means that you are trying to add a record to a table that is already there.
For example
Say you have a table that has one key field called OrderID
and in that table there is a record for OrderID 1001

If you now try to add an order to the table with orderID 1001
you will get the error you are getting.
Primary key constraints ensure that every record in your table is unique
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,511
#3: Jul 25 '08

re: ODBC--call failed.


The error message is self explanatory.

you need to check if the data already exists before inserting that to database tables.
Reply