Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Nilson Rishi
  Where is Nilson Rishi?
 Bangkok
 Thailand
 Nilson Rishi
 Tags
Subject: detect update conflicts in SQL Server
Thread ID: 104131 Message ID: 104131 # Views: 6 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, August 11, 2006 6:30:49 PM         
   


If I use remote views, if TABLEUPDATE(.T.,.F.) returns .F., a update conflict has occured.
But how to do it with SPT SQLExec(lnhdl,"UPDATE customer SET last_name = 'Rishi'")? My logic below is ok?

lnResult=SQLExec(lnhdl,"UPDATE customer SET last_name = 'Rishi'")
IF lnResult != 1 && SPT failed, because of any reasons such as update conflict,constraints violated, etc.
SQLRollback(lnhdl)
AERROR(amyError)
DO CASE
CASE amyError(1,5)=the_error_number_for_update_conflict_on_SQL_server && the SPT failure reason is a update conflict
OTHERWISE
ENDCASE
ELSE
SQLCommit(lnhdl)
ENDIF

Am I right?
Regards,
Nilson

ENTIRE THREAD

detect update conflicts in SQL Server Posted by Nilson Rishi @ 8/11/2006 6:30:49 PM
RE: detect update conflicts in SQL Server Posted by Pete Sass @ 8/16/2006 10:37:21 PM
RE: detect update conflicts in SQL Server Posted by Borislav Borissov @ 8/17/2006 9:35:47 AM
RE: detect update conflicts in SQL Server Posted by Nilson Rishi @ 9/18/2006 6:09:35 AM
RE: detect update conflicts in SQL Server Posted by Borislav Borissov @ 9/18/2006 8:59:27 AM
RE: detect update conflicts in SQL Server Posted by Pete Sass @ 9/23/2006 12:13:56 AM
RE: detect update conflicts in SQL Server Posted by Nilson Rishi @ 9/24/2006 4:46:08 PM