您的位置:首页 > 其它

[DataSet Error] Record not found or changed by another user

2007-05-16 17:21 471 查看
-- the source of the problem: use the datetime field value to locate the record
-- the particular SQL statement generated by delhpi ADOExpress

exec sp_executesql N'delete from test_table where
sequence_key_id = @P1 and
staff_id = @P2 and
trn_date = @P3 and
type = @P4 and
start_time = @P5 and
finish_time = @P6 and
completed = @P7 and
created_user = @P8 and
created_date = @P9 and
modified_user = @P10 and
modified_date = @P11
',N'@P1 varchar(50),@P2 varchar(50),@P3 datetime,@P4 varchar(50),@P5 datetime,@P6 datetime,@P7 int,@P8 varchar(50),@P9 datetime,@P10 varchar(50),@P11 datetime','1','2',
'2007-02-05 00:00:00:000','0','2007-02-05 18:42:26:000','2007-02-05 18:42:26:000',0,
'Local/David','2007-02-04 18:42:32:000','Local/David',
'2007-02-05 18:42:26:000'

-----------------
actually, it's expected to be:

delete from test_table where
sequence_key_id = @P1

solution:
-----------------
1) set the providerflag
sequence_key_id: [pfInKey, pfInUpdate, pfInWhere]
2) set the provider's UpdateMode to upWhereKeyOnly. Yeah!!!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐