deejay
May 16th, 2000, 05:46 PM
Hi
we have the following problem when inserting new rows in our SQL Server 7.0 database using ADO recordsets.
There is a requirement on the system to audit all activity on all fields in all tables. We've handled this by using triggers to insert copies of the inserted/updated rows into a seperate shadow table. The problem is that within VB, the ADO recordset picks up the unique ID of the shadow table insert rather than that of the original table on which the insert was done. This is because the @@identity, which sql server returns, holds only the id of the last inserted record.
We've tried removing the identity property from the both tables but we just end up with a zero value in the id of the recordset even though the db record has a valid ID.
Any ideas at all?????
Many thanks
we have the following problem when inserting new rows in our SQL Server 7.0 database using ADO recordsets.
There is a requirement on the system to audit all activity on all fields in all tables. We've handled this by using triggers to insert copies of the inserted/updated rows into a seperate shadow table. The problem is that within VB, the ADO recordset picks up the unique ID of the shadow table insert rather than that of the original table on which the insert was done. This is because the @@identity, which sql server returns, holds only the id of the last inserted record.
We've tried removing the identity property from the both tables but we just end up with a zero value in the id of the recordset even though the db record has a valid ID.
Any ideas at all?????
Many thanks