Primero: Los error handlers hay que dejarlos para después de probar que el código inicial funcione.
Segundo: Trata cambiando un poco tu sentencia, cambios en negritas
Código:
'on error resume next
Set Conn = Server.Createobject("ADODB.Connection")
conn.open "bd"
strSQL = "Set Nocount on "
strSQL = strSQL + "insert into TABLA1 (nombre) values ('prueba');"
strSQL = strSQL + " select @@identity AS IdentityInsert"
strSQL = strSQL + " set nocount off"
objRS.Open strSQL, Conn
objRS("IdentityInsert")
If Err <> 0 Then
Response.Write "Se ha producido un error: " & Err.Description
End If
Edit: Si no utilizas una conexión OLEDB, no funcionará esta sentencia...oops me ganó el maestro tigurón
Salud