标题: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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-211362-1-1.html




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

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