General information
Title:
Another 1-to-many problem with SQL server and VFP
Dear all,
We are developing a VFP form which has two tables included, one is 'order',
which keeps information about an order, and the other one is 'order_item',
which keeps the detailed ordered items associated with orders in 'order'
table.
These two tables are kept on SQL server. Primary key in 'table' is set to
rec_no, which is automatically numbered by SQL Server each time a record is
added, same as 'order_item', with rec_no as identity. To the 'order_item'
there is a field named 'ord_id', which stores the identity of 'order', so
that one to many relationship can be set up.
However, each time when we are trying to add new records into 'order' and
'order_item', error message occurs, which says "attemp to insert duplicate
key row in object 'order_item' with unique index 'ord_id'". It is not
realised by us. What am we doing wrong? Can someone give a hint? Many
thanks!
Best regards,
Ron.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only