win10卸载程序:asp连接MSSQL的一个小问题 请高手指点

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/27 06:01:55
mssql有表[BOSS] 表中字段为:id, Name, Type
我已经知道name为XXX
如何在ASP代码中通过name:XXX调用XXX的ID字段内容?
我菜 请用set id= 这种格式表达出来 请高手指点!不胜感激!

set id= 只有在update语句中以及存储过程中可以使用,不明白你描述的什么意思。

如果只是要获取name为xxx记录的id字段,可以这样:

n="xxx"

rs.open "select id from boss where name='"&n&"'",conn,1,3

response.write(rs("id"))

连接字符串:str="select * form BOSS where name='xxx'"
然后open方法打开数据库。
此时已经取得了RS记录集,set id=rs("id")
此时的rs("id")对应的就是name=xxx时对应的id的内容。

select id from boss where name=?
?是你name的值
你说的set id=格式是更新时用到的
update boss set id=?