| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 928 人关注过本帖
标题:ASP SQL 查询结果不显示
只看楼主 加入收藏
windyhill
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-10-30
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
ASP SQL 查询结果不显示
本人菜鸟,欢迎大侠们指导
我刚用DW VBSCRIPT做了个ASP。通过两个下拉菜单查询数据库中的内容,可是SQL语句总是不显示结果。
程序代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/test.asp" -->
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_test_STRING
Recordset2.Source = "SELECT * FROM 表1"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
Recordset1_numRows = 0


lx=request.form("select")
lw=request.form("select2")
sql="select 名称 from 表1 where 性质1="&lx&" and 性质2="&lw&""   查询为什么不出结果而是直接把语句显示出来了呢???
response.write (sql)


[local]1[/local]

=====================================================================以下是窗体部分

%>
<!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>无标题文档</title>
<style type="text/css">
<!--
#Layer1 {
    position:absolute;
    width:574px;
    height:313px;
    z-index:1;
    left: 36px;
    top: 195px;
}
#Layer2 {
    position:absolute;
    width:827px;
    height:564px;
    z-index:1;
    left: 314px;
    top: 191px;
}
-->
</style>
</head>



<body>
<div id="Layer2">
  <form id="form1" name="form1" method="post" action="测试半成功.asp">
    <label> </label>
    <label></label>
    <p>
      <label></label>
      <label></label>
      <select name="select">
        <option value="-1"></option>
        <option value="0"></option>
            </select>
    </p>
    <p>
      <label></label>
      <label>
      <select name="select2">
        <option value="-1"></option>
        <option value="0"></option>
      </select>
      </label>
    </p>
    <p>
      <label>
      <input type="submit" name="Submit" value="提交" />
      </label>
    </p>
  </form>
</div>
</html>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>


QQ截图未命名1.jpg (56.81 KB)
图片附件: 游客没有浏览图片的权限,请 登录注册
搜索更多相关主题的帖子: 数据库 菜单 include file 
2011-10-30 13:35
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:20 
<%
Dim Recordset2
Dim Recordset2_numRows
lx=request.form("select")
lw=request.form("select2")

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_test_STRING
Recordset2.Source = ="select 名称 from 表1 where 性质1="&lx&" and 性质2="&lw&""   Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
Recordset1_numRows = 0




[local]1[/local]

=====================================================================以下是窗体部分

%>

QQ:63572063
2011-10-30 16:53
快速回复:ASP SQL 查询结果不显示
数据加载中...
 
   



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

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