asp 提取数据库中的指定信息 怎么写

来源:百度知道 编辑:UC知道 时间:2024/05/26 19:25:58
我想指导asp从数据库中指定一个数据然后把它输出怎么写???????? 那位帮忙有奖励噢 ----------

<%
Set DB = OraSession.GetDatabaseFromPool(10)
strSql = "select name from testTable where id='001' "
Set DS = DB.DbCreateDynaset(strSql, 0)
%>
<html>
<head><title></title></head>
<body>
<%=DS("name")%>
</body>
</html>
<%
DB.close
DS.close
set DB = Nothing
set DS = Nothing
%>

这样页面上显示的就是你从数据库中选出来的结果,不知是不是你想要的,还有完事了一定要记得关闭DB和DS,否则可能出现错误。呵呵!