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!

Need help DELETING a record in a remote view

Status
Not open for further replies.

jrumbaug

Programmer
Apr 27, 2003
90
US
I am using VFP8.
My back end is SQL Express.

Here is the problem. The TABLEUPDATE() deletes ALL of the records of the remote view from the SQL backend while only the selected record is removed from the remote view on the client machine. I verified this by using SQL Server Management Express and doing a requery. So instead of deleting one customer order, all of his orders are deleted. Here is what I get from the command window :
Code:
USE
USE rv_Orders
APPEND blank
REPLACE idnumber WITH gpointer
REPLACE service WITH '1'
APPEND blank
REPLACE idnumber WITH gpointer
REPLACE service WITH '2'
GOTO 1   && 2 records now show in the backend 
MESSAGEBOX( TABLEUPDATE( .f. , .f.))  &&  .T.
DELETE
MESSAGEBOX( TABLEUPDATE( .f. , .f.))  &&  .F.
MESSAGEBOX( TABLEUPDATE( .t. , .f.))  &&  .F.
MESSAGEBOX( TABLEUPDATE( .f. , .t.))  &&  .T.
&& now both records are gone from backend
BROWSE         && browse window with one record

I would apreciate advice on what to try.

Jim Rumbaugh
 
Ok, I'm embarassed. After working 2 days on this, then posting for help, I find the answer an hour later.

I did not have good KEY FIELDS set in the view update criteria. I only had the IDNUMBER set. The TABLEUPDATE() works on all entries with the same KEYFIELDS. By adding TIMESTAMP to the KEY FIELD list, the TABLEUPDATE() started working on only the one deleted record. It was my lesson on the importance of good KEY FIELDS.

I consider this problem solved.

Jim Rumbaugh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top