标题:大家看看在asp里面这样有错么
只看楼主
a48567653
Rank: 1
等 级:新手上路
帖 子:45
专家分:0
注 册:2008-2-16
 问题点数:0 回复次数:3 
大家看看在asp里面这样有错么
<%    
    Set rc = Server.CreateObject("ADODB.Recordset")
    switch (request("action")){  
    case:"办公家具"
    sql = "select * from produce where News_Class = '办公家具' "
    case:"宾馆客房家具"
    sql = "select * from produce where News_Class = '宾馆客房家具' "
    case:"酒店家具"
    sql = "select * from produce where News_Class = '酒店家具' "
    case:"民用家具"
    sql = "select * from produce where News_Class = '民用家具' "
    case:"其他产品"
    sql = "select * from produce where News_Class = '其他产品' "
    default:
    sql = "select * from produce "
    }
    set rc = conn.Execute(sql)
%>
搜索更多相关主题的帖子: produce 酒店 办公家具 case 
2008-02-29 16:37
恒天装饰网
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2008-2-16
得分:0 
用select case也是一样的吧
2008-02-29 17:42
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
得分:0 
回复 1# 的帖子
<%   
    Set rc = Server.CreateObject("ADODB.Recordset")
    select case (request("action"))
    case "办公家具"
    sql = "select * from produce where News_Class = '办公家具' "
    case "宾馆客房家具"
    sql = "select * from produce where News_Class = '宾馆客房家具' "
    case "酒店家具"
    sql = "select * from produce where News_Class = '酒店家具' "
    case "民用家具"
    sql = "select * from produce where News_Class = '民用家具' "
    case "其他产品"
    sql = "select * from produce where News_Class = '其他产品' "
    case else
    sql = "select * from produce "
    end select
    set rc = conn.Execute(sql)
%>
2008-02-29 18:18
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:0 
楼主
VBS中选择语句是使用select case
2008-02-29 18:57



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




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

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