当前位置: 代码迷 >> ASP >> Dreamweaver8 读取SQL 2000 中表的数据解决思路
  详细解决方案

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

热度:453   发布时间:2012-04-14 17:14:21.0
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楼的去组合
  相关解决方案