Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP and SQLSERVER data update conflict error

Status
Not open for further replies.

dataplus

Programmer
Nov 8, 2000
1
IN
I have a order processing system written in VFP with SQL 7 as backend, I have two tables for order as header and detail table. The problem I am facing is that I am able to add new orders without any problem. When I try to modify the order having more than one items, all the rows get changed with the new data.

Example

ITEMNAME QTY RATE
=======================
ITEM1 5 10
ITEM2 15 20
ITEM3 20 25

suppose I change the ITEM2 QTY to say 50

I should expect following result

ITEMNAME QTY RATE
=======================
ITEM1 5 10
ITEM2 50 20
ITEM3 20 25

But What I am getting after saving data is

ITEMNAME QTY RATE
=======================
ITEM1 50 10
ITEM2 50 20
ITEM3 50 25

It is not always.

I checked all settings with DBSETPROP, the properties like WHERETYPE and UPDATETYPE all are correct.

Sometimes I get UPDATE CONFLICT error at time of TABLEUPDATE.

Any suggestions please

Thanks
 
How are you doing this update? Is it a replace command? Or an Update statement? I'm assuming you are using remote views...?
 
You are using remote views but you have a problem defining the Update Criteria. Most probably the set of fields that you specified as the Key Fields in the Remote View Designer are not unique key values.

So, when you update a field in the view all the records in the table that match with the update criteria will be updated also.

Edwin Dalorzo
edalorzo@hotmail.com

 
I was getting this message when I was added a whole pile of information at once and my primary key was a SQL autonumber. What would have happen is in the view I would get a 0 in that field. When I was done with my bulk add I issued a =requery() command before I did anything else to get the key and the message went away. I have just asked if someone can help me out by telling me how to get that ID without doing a =requery() as this can take a while.

Hope this helps.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top