Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another 1-to-many problem with SQL server and VFP
Message
From
04/12/1997 10:00:57
Ron Tse-Jung Huang
Leader Professional Consulting
Shin-Chu, Taiwan
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Another 1-to-many problem with SQL server and VFP
Miscellaneous
Thread ID:
00063768
Message ID:
00063768
Views:
77
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
Map
View

Click here to load this message in the networking platform