Trigger fails from the VB application side
When I edit the data via the enterprise manager, the trigger executes successfully. However, from my VB application (using Adodc), it says,
"Row cannot be located for updating. Some values may have been changed since it was last read."
Any idea why this is happening please?
======================================================
CREATE TRIGGER [dbo].[trg_ins_update_inspection] ON [dbo].[tbl_ge_inspection]
FOR INSERT, UPDATE
AS
DECLARE @lng_id bigint
DECLARE @lng_clientid bigint
DECLARE @str_inspname nvarchar(20)
DECLARE @str_category nvarchar(20)
DECLARE @dte_mod_on datetime
DECLARE CurD cursor for select
lng_id ,
lng_clientid ,
str_inspname,
str_category
FROM inserted
open CurD
Fetch Next From CurD into
@lng_id ,
@lng_clientid ,
@str_inspname ,
@str_category
WHILE (@@FETCH_STATUS <> -1)
BEGIN
UPDATE dbo.web_tbl_reports SET str_category=@str_category, dte_mod_on = getdate() WHERE lng_clientid=@lng_clientid AND str_inspname = @str_inspname
Fetch Next From CurD into
@lng_id ,
@lng_clientid ,
@str_inspname,
@str_category
END
Close CurD
DEALLOCATE CurD
======================================================

