| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 581 人关注过本帖
标题:execute问题
只看楼主 加入收藏
wenlinyang
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-4-26
收藏
 问题点数:0 回复次数:0 
execute问题
源代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>使用execute方法查询数据</title>
</head>

<body>
 <%
   set conn=server.CreateObject("adodb.connection")
   dsntemp="driver={microsoft access driver (*.mdb)};"
   dsntemp=dsntemp & "dbq=" & server.MapPath("hello.mdb")
   conn.open dsntemp
   set rs=conn.execute("select * from hTable",howmany,adcmdtext)
   response.Write "<table border=1>"
   response.Write "<tr>"
   for i=0 to rs.fields.count-1
       response.Write "<td>" & rs(i).name & "</td>"
    next
    response.Write "</tr>"
    while not rs.eof
       response.Write "<tr>"
      for i=0 to rs.fields.count-1
        response.Write "<td>" & rs(i).value & "</td>"
      next
      rs.movenext
      response.Write "</tr>"
    wend
    response.Write "</table>"
    response.Write "共有" & howmany & "条记录"
    rs.close
    conn.close
 %>
</body>
</html>
显示结果
编号 hColumn
11 goodbye
14 new Data
15 new Data
共有-1条记录
不知道哪里错了,结果显示共有-1条记录。哪位能帮忙改改,小弟先谢了
搜索更多相关主题的帖子: execute 源代码 DTD dsntemp 
2008-04-27 21:01
快速回复:execute问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013804 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved