如何向数据库理插入的同时读出该id号?

我使用的sql server7.0 数据库,数据源使用的是文件dsn.最好是能用存储过程解决,直接用sql语句也可。
---------------------------------------------------------------

try
sql="execute sp_insertproduct '" &chrproductname & "','" &txtdescription &"','" &chrproductimage &"',"&intprice &","&intactive & ";select @@identity as 'id'"
set rsproduct=dbproduct.execute(sql)
set rsproduct=rsproduct.nextrecordset
response.write rsproduct("id")

Published At
Categories with Web编程
comments powered by Disqus