i´m using a database called "test". This database have just one table,
called "Table1". The structure of this table:
CREATE TABLE [Table1] (
[id] [int] IDENTITY (2, 1) NOT NULL ,
[nome] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
this table is REPLICATED (MERGE REPLICATION) .
When i update the recordset i can´t retrive the identity value
after the rs.update command.
But when i drop the publication of this articles this problems immediatly stops
the code i used above
Set teste_conn = Server.CreateObject("ADODB.Connection")
teste_conn.Open "Driver={SQL Server};server=xxx;uid=xxxx;pwd=xxxx;database=TEST "
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "SELECT * FROM table1 WHERE id=0",teste_conn,1,2
If rs.EOF Then rs.Addnew
rs("nome")="AAAAAAAA"
rs.Update
' ---- I NEED TO GET THIS VALUE----
id = rs("id")
'--------------
rs.Close
Set rs = Nothing
teste_conn.Close
Set teste_conn = Nothing