首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

asp的一个小输出显示有关问题

2012-12-31 
asp的一个小输出显示问题If not isN(lang) Then aWhere aWhere & AND d_language & lang & If

asp的一个小输出显示问题


    If not isN(lang) Then aWhere = aWhere & " AND d_language ='" & lang & "' "
    If topic > 0 Then aWhere = aWhere & " AND d_topic = " & topic & " "
    If level > 0 Then aWhere = aWhere & " AND d_level = " & level & " "
    If state = 1 Then
        aWhere = aWhere & " AND d_state>0 "
    ElseIf state = 2 Then
        aWhere = aWhere & " AND d_state=0 "
    End If
    If hide > -1 then
    aWhere = aWhere & " AND d_hide= " & hide &" "
    end if
    
    If repeat = "ok" Then
        Dim repeatSearch: repeatSearch = " d_name "
        If app_dbtype = "access" And repeatlen > 0 Then
            repeatSearch = " LEFT(d_name," & repeatlen & ") "
        ElseIf app_dbtype = "mssql" And repeatlen > 0 Then
            repeatSearch = " SUBSTRING(d_name,0," & repeatlen & ") "
        End If
        aWhere = aWhere & " AND d_name IN (SELECT " & repeatSearch & " FROM {pre}vod GROUP BY " & repeatSearch & " HAVING COUNT(*)>1) "
    End If
    If isN(order) Then order = "d_time"
    
    If not isN(sserver) Then aWhere = aWhere & " AND d_playserver like N'%" & sserver & "%' "
    If not isN(from) Then aWhere = aWhere & " and d_playfrom like N'" & from & "%' "
    If not isN(down) Then aWhere = aWhere & " and d_downfrom like N'" & down & "%' "
    
    If spic=1 then
    aWhere = aWhere & " and d_pic= '' "
    elseif spic=2 then
    aWhere = aWhere & " and d_pic like N'http://%' "
    elseif spic=3 then
    aWhere = aWhere & " and d_pic like N'%#err%' "
    end if
    
    Dim sql: sql

 = "SELECT d_id, d_name, d_enname, d_type,d_state,d_topic,d_color,d_level,d_hits,d_addtime,d_time,d_remarks,d_playfrom,d_downfrom,d_hide FROM {pre}vod WHERE" & aWhere & " ORDER BY " & order & " DESC"
    
    Dim rs: Set rs = objdb.DB(sql, "rs1")
%>
上面根据传入的值有一堆判断,我传入的stype=6,但是不显示结果,我就想知道这个sql变量到底最后的完整字符串是什么,谁能告诉我怎么在页面输出显示sql,或者怎么最简单让我知道最后sql是什么
没学过asp,见谅,,,就是查不出来内容,我估计是因为我把数据库的varchar改成nvarchar和ntext的事,就是不知道最后sql到底是什么语句,所以不知道哪里的原因
[解决办法]
Response.Write(sql)

热点排行