September 20, 2006 at 5:55 am
Hi,
I have a problem when merge replication is active on my database. Without it I can open a keyset recordset, add a record and will have the Identity Key value returned to the recordset when updated. However, When merge replication is active the identity key does not get returned, I get 0 instead.
Does anyone know why this is happening ?.
Thanks
Stuart
September 21, 2006 at 2:21 am
Hi Stuart,
isn't merge replication relevant to SQL Server rather than Access?
September 21, 2006 at 5:31 am
Hi Grovelli,
The problem is occuring in my Access application - the merge replication works fine so I did not consider there to be a problem there.
September 21, 2006 at 5:31 am
At a first guess, maybe some thing to do with the replication is firing a trigger, thus altering the value of the last identity created.
Are you using @@identity or scope_identity() to retrieve the identity value generated?
September 21, 2006 at 7:44 am
Hi Chris,
Thanks for looking at this.
My code in simple terms is as follows :
Dim intIdentReturn as Integer
Dim SqlRs as Adodb.Recordset
With SqlRs
.Open "tblName", SqlConn, adOpenKeyset, adLockPessimistic
.Addnew
!Fieldname = "AddValueHere"
.Update
intIdentReturn = !IdentityKeyField
End With
This works fine without merge replication but as soon as its on it returns 0 to intIdentReturn.
Thanks
Stuart
September 21, 2006 at 9:14 am
The problem is definitely caused by the insert trigger created by merge replication.
Thanks Chris:
Stuart
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply