怎么在程序中获取 sql2000 中 scope_IDENTITY()的返回值

如何在程序中获取 sql2000 中 scope_IDENTITY()的返回值
在程序中需要获取刚插入的记录中ID(自增、标识列)的值。

我的想法是:在addnew后,不管在update之前或之后调用

id=conn.execute("select top 1 scope_IDENTITY() from tab").fields(0)

都好像不行,各位大侠有什么好办法??谢谢!!!

------解决方案--------------------
sql="select top 1 scope_IDENTITY() from tab" 
rs.Open sql, cn, adOpenStatic, adLockReadOnly