主题:  点第一个新闻,再点第二个它显示的还是第一个,why??

daifan

职务:普通成员
等级:1
金币:0.0
发贴:24
#12004/6/8 20:09:53
见这个网站
daifan.huaw.net

怎么回事?

还有,我想让新闻浏览窗口变成没有工具栏等的窗口
怎么弄??



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#22004/6/9 8:47:19
where newid = "&ArticleID



daifan

职务:普通成员
等级:1
金币:0.0
发贴:24
#32004/6/10 18:33:32
还是不行啊!!!



daifan

职务:普通成员
等级:1
金币:0.0
发贴:24
#42004/6/11 20:00:05
???



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#52004/6/11 20:53:04
你把代码发上来看看啊



daifan

职务:普通成员
等级:1
金币:0.0
发贴:24
#62004/6/11 22:25:17
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/class1.asp" -->
<%
Dim news
Dim news_numRows

Set news = Server.CreateObject("ADODB.Recordset")
news.ActiveConnection = MM_class1_STRING
news.Source = "SELECT * FROM News WHERE ArticleID"
news.CursorType = 0
news.CursorLocation = 2
news.LockType = 1
news.Open()

news_numRows = 0
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

' use index parameter if defined, otherwise use offset parameter
MM_param = Request.QueryString("index")
If (MM_param = "") Then
MM_param = Request.QueryString("offset")
End If
If (MM_param <> "") Then
MM_offset = Int(MM_param)
End If

' if we have a record count, check if we are past the end of the recordset
If (MM_rsCount <> -1) Then
If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last
If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If

' move the cursor to the selected record
MM_index = 0
While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1))
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
If (MM_rs.EOF) Then
MM_offset = MM_index ' set MM_offset to the last possible record
End If

End If
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links

Dim MM_keepMove
Dim MM_moveParam
Dim MM_moveFirst
Dim MM_moveLast
Dim MM_moveNext
Dim MM_movePrev

Dim MM_urlStr
Dim MM_paramList
Dim MM_paramIndex
Dim MM_nextParam

MM_keepMove = MM_keepBoth
MM_moveParam = "index"

' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 1) Then
MM_moveParam = "offset"
If (MM_keepMove <> "") Then
MM_paramList = Split(MM_keepMove, "&")
MM_keepMove = ""
For MM_paramIndex = 0 To UBound(MM_paramList)
MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1)
If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then
MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex)
End If
Next
If (MM_keepMove <> "") Then
MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
End If
End If
End If

' set the strings for the move to links
If (MM_keepMove <> "") Then
MM_keepMove = Server.HTMLEncode(MM_keepMove) & "&"
End If

MM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="

MM_moveFirst = MM_urlStr & "0"
MM_moveLast = MM_urlStr & "-1"
MM_moveNext = MM_urlStr & CStr(MM_offset + MM_size)
If (MM_offset - MM_size < 0) Then
MM_movePrev = MM_urlStr & "0"
Else
MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)
End If
%>
<html>
<head>
<title>play.gif</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--Fireworks MX 2004 Dreamweaver MX 2004 target. Created Mon Jun 07 12:41:39 GMT+0800 2004-->
<style type="text/css">
<!--
.style1 {font-size: 12px}
body {
    margin-top: 0px;
    margin-bottom: 0px;
}
.style6 {
    font-size: 24px;
    color: #FF8000;
    font-weight: bold;
}
-->
</style>
</head>
<body bgcolor="#ffffff">

<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="800">
<!-- fwtable fwsrc="?′?ü??" fwbase="play.gif" fwstyle="Dreamweaver" fwdocid = "183101202" fwnested="0" -->
<tr>
<td><img src="spacer.gif" width="46" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="113" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="554" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="44" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="43" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="4">&nbsp;</td>
<td colspan="3"><img name="play_r2_c2" src="Play_image/play_r2_c2.gif" width="711" height="127" border="0" alt=""></td>
<td rowspan="4">&nbsp;</td>
<td><img src="spacer.gif" width="1" height="127" border="0" alt=""></td>
</tr>
<tr>
<td><img name="play_r3_c2" src="Play_image/play_r3_c2.gif" width="113" height="355" border="0" alt=""></td>
<td valign="top" class="style1"><div align="center">
<table width="554" height="301" border="0">
<tr>
<td height="17" class="style1"><div align="center">
<p class="style6"><%=(news.Fields.Item("Title").value)%></p>
</div></td>
</tr>
<tr>
<td height="33" valign="middle" class="style1"><div align="center">
<p>&#20316;&#32773;&#65306;<%=(news.Fields.Item("NewsPerson").value)%></p>
</div></td>
</tr>
<tr>
<td height="187" valign="top" class="style1"><form name="form1" method="post" action="">
<textarea name="textarea" cols="75" rows="13"><%=(news.Fields.Item("Content").value)%></textarea>
</form> </td>
</tr>
<tr>
<td height="45" valign="top" class="style1"><p align="right"><%=(news.Fields.Item("Updatesj").value)%></p>
</td>
</tr>
</table>
</div></td>
<td rowspan="2"><img name="play_r3_c4" src="Play_image/play_r3_c4.gif" width="44" height="381" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="355" border="0" alt=""></td>
</tr>
<tr>
<td colspan="2"><img name="play_r4_c2" src="Play_image/play_r4_c2.gif" width="667" height="26" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="26" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
<td><img src="spacer.gif" width="1" height="47" border="0" alt=""></td>
</tr>
</table>
</div>
</body>
</html>
<%
news.Close()
Set news = Nothing
%>

编辑历史:[此帖最近一次被 daifan 编辑过(编辑时间:2004-06-11 22:31:33)]


daifan

职务:普通成员
等级:1
金币:0.0
发贴:24
#72004/6/11 22:26:57
笑脸是")"



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#82004/6/12 10:43:10
news.Source = "SELECT * FROM News WHERE ArticleID"



你"还是不行啊!!!"的结论是怎么来的?



死不了

职务:普通成员
等级:1
金币:0.0
发贴:89
#92004/6/12 12:42:17
DW做的吧



janlay

职务:管理员
等级:7
金币:28.0
发贴:7244
#102004/6/12 12:51:30
WHERE ArticleID,这表示,先将 ArticleID 自动转换成bit数据类型后,再判断真假,当它不为 0,就返回真。于是,就相当于 where 1=1, 这个条件会选择所有的行。

取出全部行后,记录集位于第一条。只要不移动记录指针,它就总是得到第一条记录的数据。

剩下的你应该知道怎么做



daifan

职务:普通成员
等级:1
金币:0.0
发贴:24
#112004/6/13 16:43:39
janlay在上个帖子中说
引用:
WHERE ArticleID,这表示,先将 ArticleID 自动转换成bit数据类型后,再判断真假,当它不为 0,就返回真。于是,就相当于 where 1=1, 这个条件会选择所有的行。

取出全部行后,记录集位于第一条。只要不移动记录指针,它就总是得到第一条记录的数据。

剩下的你应该知道怎么做

应该怎么改??



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#122004/6/13 18:19:41
Dim news
Dim news_numRows
Dim ID
If Request.QueryString("ArticleID") <> "" then
ID = Request.QueryString("ArticleID")
Else
Response.Write("错误的参数信息")
Response.End()
End If


Set news = Server.CreateObject("ADODB.Recordset")
news.ActiveConnection = MM_class1_STRING
news.Source = "SELECT * FROM News WHERE ArticleID = "& ID



daifan

职务:普通成员
等级:1
金币:0.0
发贴:24
#132004/6/13 18:37:29
这样运行后它说

错误类型:
ADODB.Field (0x800A0E78)
对象关闭时,不允许操作。
/Class_News/News_Play.asp, 第 213 行



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#142004/6/14 9:02:36
213行是什么



daifan

职务:普通成员
等级:1
金币:0.0
发贴:24
#152004/6/14 21:39:43
<p class="style6"><%=(news.Fields.Item("Title").value)%></p>