首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

Dreamweaver8 读取SQL 2000 中表的数据解决思路

2012-04-14 
Dreamweaver8 读取SQL 2000 中表的数据2个页面 一个是products.asp一个是 buy.asp在products.asp 中td wi

Dreamweaver8 读取SQL 2000 中表的数据
2个页面 一个是products.asp 一个是 buy.asp 
在products.asp 中  
<td width="76%" align="center"><input name="Submit" type="button" value="购买" onclick="vbscript:location.href='buy.asp?id=<%=id%>'""/>
在 buy.asp 中 建立表单 表单中的 产品类型 是在 web_Laos_Product 这个表中根据 id 的值来寻找这一行中Laos_title(产品类型)的值 并在网页上显示出来

set rs0=server.CreateObject("adodb.recordset")
strsql="select * from web_Laos_Product where Laos_id="& id &" "
这里的第二行怎么写?? 怎么判断?
谢谢各位大大

[解决办法]
rs0=conn.execute(strsql)
response.write(rs.fields("字段名"))
[解决办法]
rs.open sql,conn,1,1
if not rs.eof then '如果有数据
Laos_title=rs("字段名")
response.write(Laos_title) '输出
else
response.write("没有数据")
end if
rs.close '关闭
set rs=nothing '释放

[解决办法]
if not rs.bof or not rs.eof then
......
end if
[解决办法]
数据库连接呢?你不说谁知道怎么写
你学习一下,1楼和3楼的去组合

热点排行