ADO Adding a record; Retrieving ID; Record is Deleted (1 Viewer)

joeKra

Registered User.
Local time
Today, 06:40
Joined
Jan 24, 2012
Messages
208
I'm having an Access FE with SQL server 2014 BE. when adding a record via ADO and trying to Retrieve the Identity ID I'm getting An error "Record is deleted"
as per my research, it has to do with having a trigger "For Insert" but the trigger is only adding a record to an unrelated table, so I'm not sure what's going on over here.

Code:
ALTER TRIGGER [dbo].[billingPay.Insert]
    ON [dbo].[BillingPay]
    FOR  INSERT
    AS

    BEGIN

	INSERT INTO [dbo].[Transactions]
			([TransID]
			,[Type]
			,[Date]
			,[Amount]
			,[Balance]
			,[Rep]
			,[CustomerID]
			   --,[Project]
			   --,[ToPrint]
			   --,[ToEmail]
			   --,[Applied]
			   --,[ProjectID]
			   )

		select BilingPayID,'Payment',getdate(),[Amount],[Amount],Rep,CustomerID from inserted
	--end

	--EXEC UpdateCustomerBalance @CustomerID
	SET NOCOUNT ON
	
	
	END
 

Minty

AWF VIP
Local time
Today, 11:40
Joined
Jul 26, 2013
Messages
10,370
How are you trying to retrieve the ID ?
 

Users who are viewing this thread

Top Bottom