标题:[求助]这个是什么原因
只看楼主
sncelpl
Rank: 1
等 级:新手上路
帖 子:87
专家分:0
注 册:2006-6-28
结帖率:86.67%
 问题点数:0 回复次数:4 
[求助]这个是什么原因

<%
Dim s_RootID
'当然更改为其他跟栏目的时候,只需要适当的更改下面的值,就可以实现不同栏目。
s_RootID = "A"

Sub GetNewsCata()
Dim cRs, cSql, i, TempCataStr
Set cRs = Server.CreateObject( "ADODB.Recordset" )
cSql = "SELECT * FROM DdsCata WHERE C_ID <> 1 ORDER BY C_RootID"
cRs.Open cSql, oConn, 1, 3

Do While Not cRs.EOF

TempCataStr = "<option value='"&Trim(cRs("C_ID"))&"'>"
TempCataStr = TempCataStr&"&nbsp;|"

For i=1 To Int(Len(Trim(cRs("C_RootID")))/4) - 1
TempCataStr = TempCataStr&"&nbsp;|"
Next

TempCataStr = TempCataStr&"_"&Trim(cRs("C_Title"))&"</option>"
Response.Write TempCataStr

cRs.MoveNext
Loop
cRs.Close
Set cRs = Nothing
End Sub
%>
<td width="18%"></td>
<td class="font_mb green"><font color="#C41039">月检修计划</font></td>
<td align="right"><a href="News sDefault.asp?cataid=A00017" class="tt2">更多</a></td>
</tr>
</table></td>
<td width="1%" background="Images/Bg_2.gif"></td>
<td width="44%" background="Images/Nav_Title_4.gif">
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="18%"> </td>
<td class="font_mb green"><font color="#006F68">继电保护定值通知单</font></td>
<td align="right"><a href="News sDefault.asp?cataid=A0006" class="tt2">更多</a></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><Script Language="JavaScript" Src="<%=RootUrl%>/News sNews.asp?Cataid=A0001&Attr=0&ChildCata=0&Style=1&RowNum=10&ColNum=1&TitleNum=12&TitleCSS=&Line_H=24&More=0&MoreCSS=&Date=2&Click=0&Postfix=&NaviPic=7&OpenMode=1"></Script></td>
<td background="Images/Bg_2.gif"></td>
<td valign="top"><Script Language="JavaScript" Src="<%=RootUrl%>News sNews.asp?Cataid=A0006&Attr=0&ChildCata=0&Style=1&RowNum=10&ColNum=1&TitleNum=12&TitleCSS=&Line_H=24&More=0&MoreCSS=&Date=2&Click=0&Postfix=&NaviPic=7&OpenMode=1"></Script></td>
</tr>
<td valign="top"><Script Language="JavaScript" Src="<%=RootUrl%>/News sNews.asp?Cataid=A0001&Attr=0&ChildCata=0&Style=1&RowNum=10&ColNum=1&TitleNum=12&TitleCSS=&Line_H=24&More=0&MoreCSS=&Date=2&Click=0&Postfix=&NaviPic=7&OpenMode=1"></Script>
我改成:<td valign="top"><Script Language="JavaScript" Src="<%=RootUrl%>/News sNews.asp?Cataid=A00010&Attr=0&ChildCata=0&Style=1&RowNum=10&ColNum=1&TitleNum=12&TitleCSS=&Line_H=24&More=0&MoreCSS=&Date=2&Click=0&Postfix=&NaviPic=7&OpenMode=1"></Script>
就正常了地址如果是A0001就不行

搜索更多相关主题的帖子: option 
2007-03-29 08:54
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
得分:0 

不知道s_RootID在程序里有什么作用,只声明了,没看见有使用的地方;

地址如果是A0001就不行,不明白什么意思


专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2007-03-29 09:05
guyer
Rank: 2
等 级:新手上路
威 望:5
帖 子:451
专家分:0
注 册:2007-1-19
得分:0 

他没发全 给你看着个

<!--#include file = "../Include/DBClass.inc.asp"-->
<%
Dim T_CataID, T_Attr, T_ChildCata, T_Style, T_RowNum, T_ColNum, T_TitleNum, T_TitleCSS, T_ContentNum, T_ContentCSS, T_LineSpace, T_More, T_MoreCSS, T_DateType, T_Postfix, T_Align, T_New, T_NaviPic, T_OpenMode, T_ShowClick

T_CataID = GetSafeStr(Trim(Request("Cataid")))
If T_CataID = "" Then T_CataID = "A"
T_Attr = GetSafeInt(Trim(Request("Attr")),0)
T_ChildCata = GetSafeInt(Trim(Request("ChildCata")),0)
T_Style = GetSafeInt(Trim(Request("Style")),1)
T_RowNum = GetSafeInt(Trim(Request("RowNum")),6)
T_ColNum = GetSafeInt(Trim(Request("ColNum")),1)
T_TitleNum = GetSafeInt(Trim(Request("TitleNum")),15)
T_TitleCSS = GetSafeStr(Trim(Request("TitleCSS")))
If T_TitleCSS = "" Then T_TitleCSS = "tt1"
T_ContentNum = GetSafeInt(Trim(Request("ContentNum")),30)
T_ContentCSS = GetSafeStr(Trim(Request("ContentCSS")))
If T_ContentCSS = "" Then T_ContentCSS = "font_h_14"
T_LineSpace = GetSafeInt(Trim(Request("Line_H")),24)
T_More = GetSafeInt(Trim(Request("More")),0)
T_MoreCSS = GetSafeStr(Trim(Request("MoreCSS")))
If T_MoreCSS = "" Then T_MoreCSS = "tt2"
T_DateType = GetSafeInt(Trim(Request("Date")),0)
T_Postfix = GetSafeStr(Trim(Request("Postfix")))
If T_Postfix = "" Then T_Postfix = "gray"
T_Align = GetSafeInt(Trim(Request("Align")),0)
T_New = GetSafeInt(Trim(Request("New")),0)
T_NaviPic = GetSafeInt(Trim(Request("NaviPic")),0)
T_OpenMode = GetSafeInt(Trim(Request("OpenMode")),1)
T_ShowClick = GetSafeInt(Trim(Request("Click")),0)


Dim dRs, dSql, Flag
Set dRs = Server.CreateObject( "ADODB.Recordset" )
dSql = "SELECT * FROM DdsCata WHERE C_RootID LIKE '"&T_CataID&"%'"
dRs.Open dSql, oConn, 0, 1
If dRs.EOF Then
Flag = 1
End If
dRs.Close
Set dRs = Nothing

Dim TempContent
TempContent="<table cellspacing='0' cellpadding='0' width='96%' align='center' border='0'>"
TempContent=TempContent&" <tr>"
TempContent=TempContent&" <td height='4'></td>"
TempContent=TempContent&" </tr>"

If Flag = 1 Then
TempContent=TempContent&" <tr><td>对不起,此信息类别不存在!</td></tr>"
Else
Dim fRs, fSql, SqlString, NewsNum, o_Char, o_Num, Target, i

If News_Check = 1 Then
Select Case T_Attr
Case 0
SqlString = "And D_Num =1 ORDER BY D_SortID DESC"
Case 1
SqlString = "And (D_Num =1 And D_Special = 1) ORDER BY D_SortID DESC"
Case 2
SqlString = "And D_Num =1 ORDER BY D_Hits DESC"
End Select
Else
Select Case T_Attr
Case 0
SqlString = "ORDER BY D_SortID DESC"
Case 1
SqlString = "And D_Special = 1 ORDER BY D_SortID DESC"
Case 2
SqlString = "ORDER BY D_Hits DESC"
End Select
End If

NewsNum = T_RowNum * T_ColNum
Set fRs = Server.CreateObject( "ADODB.Recordset" )
fSql = "SELECT TOP "& NewsNum &" * FROM DdsData WHERE D_CataID LIKE '"&T_CataID&"%' "& SqlString

fRs.Open fSql,oConn,0,1
If fRs.EOF or fRs.BOF Then
TempContent=TempContent&" <tr><td>暂时没有任何信息!</td></tr>"
End If

If T_OpenMode = 1 Then
Target ="target='_blank'"
Else
Target ="target='_parent'"
End If

TempContent=TempContent&" <tr>"
i = 0
Do While Not fRs.EOF And NewsNum > 0

If T_Style = 2 Then
TempContent = TempContent &"<td valign='top'>"
TempContent = TempContent &"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
TempContent = TempContent &" <tr>"
TempContent = TempContent &" <td height='"& T_LineSpace &"' class='"& T_TitleCSS &"'>"
If T_NaviPic <> 0 Then TempContent = TempContent &"<img src='"& RootUrl &"/News/images/Dot_"& T_NaviPic &".gif' align='absmiddle'>"

If Get_TrueLen(GetSafeStr(fRs("D_Title"))) > 2*Cint(T_TitleNum) Then
TempContent = TempContent &"&nbsp;"& Get_String(GetSafeStr(fRs("D_Title")),2*T_TitleNum-3) &"...</td>"
Else
TempContent = TempContent &"&nbsp;"& GetSafeStr(fRs("D_Title")) & "</td>"
End If

TempContent = TempContent &" </tr>"
TempContent = TempContent &" <tr>"
TempContent = TempContent &" <td class='"& T_ContentCSS &"'>" & Get_String(GetTxtStr(GetLineStr(fRs("D_Content"))),2*T_ContentNum) &"...</td>"
TempContent = TempContent &" </tr>"
If T_More = 1 Then
TempContent = TempContent &" <tr>"
TempContent = TempContent &" <td align='right'><a href='"& RootUrl &"/News/DdsShow.asp?id="& fRs("D_ID") &"' class='"& T_MoreCSS &"'>&gt;&gt;&nbsp;更多内容</a>&nbsp;</td>"
TempContent = TempContent &" </tr>"
End If
TempContent = TempContent &"</table>"
TempContent = TempContent &"</td>"
Else
o_Char = ""
o_Num = 1
Dim CataName, gRs, gSql
Set gRs = Server.CreateObject( "ADODB.Recordset" )
gSql = "SELECT C_Title FROM DdsCata WHERE C_RootID = '"& fRs("D_CataID") &"' ORDER BY C_ID DESC"
gRs.Open gSql,oConn,0,1
If Not gRs.EOF Then
CataName = gRs("C_Title")
End If
gRs.Close
Set gRs = Nothing

If T_DateType > 0 Then
Select Case T_DateType
Case 1
o_Char = o_Char & Year(fRs("D_AddTime"))&"-"&Month(fRs("D_AddTime"))&"-"&Day(fRs("D_AddTime"))
Case 2
o_Char = o_Char & Format_Time(fRs("D_AddTime"),2)
Case 3
o_Char = o_Char & Year(fRs("D_AddTime"))&"/"&Month(fRs("D_AddTime"))&"/"&Day(fRs("D_AddTime"))
Case 4
o_Char = o_Char & Month(fRs("D_AddTime"))&"/"&Day(fRs("D_AddTime"))&"/"&Year(fRs("D_AddTime"))
Case 5
o_Char = o_Char & Month(fRs("D_AddTime"))&"-"&Day(fRs("D_AddTime"))&"-"&Year(fRs("D_AddTime"))
Case 6
o_Char = o_Char & Month(fRs("D_AddTime"))&"-"&Day(fRs("D_AddTime"))
Case 7
o_Char = o_Char & Month(fRs("D_AddTime"))&"/"&Day(fRs("D_AddTime"))
Case 8
o_Char = o_Char & Month(fRs("D_AddTime"))&"月"&Day(fRs("D_AddTime"))&"日"
Case Else
o_Char = o_Char & Year(fRs("D_AddTime"))&"年"&Month(fRs("D_AddTime"))&"月"&Day(fRs("D_AddTime"))&"日"
End Select
End If
If T_ShowClick = 1 Then o_Char = o_Char &" 浏览:"& fRs("D_Hits")
If o_Char <> "" Then o_Char = "<span class='"& T_Postfix &"'>["& o_Char & "]</span>"

TempContent = TempContent &" <td height="& T_LineSpace &">"
If T_ChildCata = 1 Then TempContent = TempContent &"<font color=#FF6600>["& CataName &"]</font>"
If T_NaviPic <> 0 Then TempContent = TempContent &"&nbsp;<img src='"&RootUrl&"/News/images/Dot_"& T_NaviPic &".gif' align='absmiddle'> "

If Trim(fRs("D_Url")) <> "" Then
TempContent = TempContent &"<a href='"&fRs("D_Url")&"' class='"& T_TitleCSS &"' "& Target &">"
Else
TempContent = TempContent &"<a href='"&RootUrl&"/News/DdsShow.asp?id="&fRs("D_ID")&"' class='"& T_TitleCSS &"' "& Target &">"
End If

If Trim(fRs("D_Color")) <> "" Then
TempContent = TempContent &"<font color='"& fRs("D_Color") &"'>"
End If

If Get_TrueLen(GetSafeStr(fRs("D_Title"))) > 2*Cint(T_TitleNum) Then
TempContent = TempContent & Get_String(GetSafeStr(fRs("D_Title")),2*T_TitleNum-3)
Else
TempContent = TempContent & GetSafeStr(fRs("D_Title"))
End If

If Trim(fRs("D_Color")) <> "" Then
TempContent = TempContent &"</font>"
End If

TempContent = TempContent &"</a>"

If T_New = 1 and Format_Time(Now(),5) - Format_Time(fRs("D_AddTime"),5) < 2 Then
TempContent = TempContent &"<img src='"& RootUrl &"/News/Images/New.gif' align='absmiddle'>"
End If
If T_Align = 1 Then
TempContent = TempContent &"</td><td align='right'>"
o_Num = 2
End If
TempContent = TempContent & o_char &"</td>"
End If

NewsNum = NewsNum - 1
i = i + 1
if i mod T_ColNum = 0 Then TempContent = TempContent& "</tr><tr>"

fRs.MoveNext
Loop
fRs.Close
Set fRs = Nothing
TempContent=TempContent&" </tr>"

If T_More = 1 and T_Style <> 2 Then
TempContent=TempContent&" <tr><td colspan='"& o_Num*T_ColNum &"' align='right'><a href='"&RootUrl&"/News/Default.asp?cataid="& T_CataID &"' class='"& T_MoreCSS &"'>&gt;&gt;&nbsp;更多内容</a>&nbsp;</td></tr>"
End If

End If
TempContent=TempContent&"</table>"
Call DBConnEnd()
%>
document.write("<%=TempContent%>");

也是他的


http://www./
2007-03-29 09:53
guyer
Rank: 2
等 级:新手上路
威 望:5
帖 子:451
专家分:0
注 册:2007-1-19
得分:0 
这个是取得News sNews.asp?Cataid=的值 之后的查询 

我感觉向是查询方法不对 dSql = "SELECT * FROM DdsCata WHERE C_RootID LIKE '"&T_CataID&"%'"

他用是 LIKE

所以显示的数据 会多一些,

http://www./
2007-03-29 09:55
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
得分:0 
不太明白楼主要表达的是什么意思!!

http://www./
2007-03-29 09:56



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




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

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