ASP中从SQL中提取一个记录的某一项的语句是什么

来源:百度知道 编辑:UC知道 时间:2024/05/18 01:11:34
比如有个表,叫表1吧,现在要从这个表的第一项中提取它的内容,并赋值给一个变量a,请问该怎么写

set rs=server.createobject("adodb.recordset")
rs.open "select 字段 from 表 where 条件",conn,1,1
if not rs.eof then
response.write "第一项内容是:"&rs("字段")
dim myValue=rs("字段")'赋值
end if
rs.close
set rs=nothing

select 你想取的项 AS A from 1 where 条件