Database Error!!!
I'm not sure if I have posted in the right topic but i do hope some one can help.
I'm trying to move a topic thread to another area but whenever i click for move it dun seems able to find the page. Y??? Can someone help
Below is my script:
<%
response.expiresAbsolute = now() - 1.5
'stop this flogging page from caching
forum = Request("forum")
edit = Request("edit")
Set rsForums = Conn.Execute("SELECT General.*, PER_TEMPLATE.* From [General] INNER JOIN PER_TEMPLATE ON General.PER" & intGroup & " = PER_TEMPLATE.TEMPLATE_ID WHERE TopicID =" & forum)
blnModMove = rsForums("MOD_MOVE")
blnModLock = rsForums("MOD_LOCK")
blnModDelete = rsForums("MOD_DELETE")
blnModEdit = rsForums("MOD_EDIT")
blnModSplit = rsForums("MOD_SPLIT")
If blnModMove = true OR blnModLock = true OR blnModDelete = true OR blnModEdit = true OR blnModSplit = true then
'it is all good
Else
Set Conn = nothing
Response.Write "Permission NOT granted."
Response.End
End If
if Request("move") <> "" AND blnModMove = true then
Set rsBBS = Conn.Execute("SELECT * FROM BBS Where ThreadID = " & Request("edit"))
Set rsForums = Conn.Execute("SELECT * FROM [General] WHERE TopicID = " & Request("move"))
'create new post with "MOVED - " & name
Conn.Execute("INSERT INTO BBS ([ParentThread], [ParentForum], [LastPostBy], [Message], [ThreadPostTime], [Moved]) VALUES (" &_
rsBBS("ParentThread") & ", " & rsBBS("ParentForum") & ", " & rsBBS("Poster") &_
", '<strong><a href=""ViewThread.asp?Thread=" & rsBBS("ThreadID") & Request("move") & """>" & rsBBS("Title") & "</a></strong> moved to <strong><a href=""ViewForum.asp?forum=" & Request("move") & """>" & rsForums("ForumTitle") & "</a></strong', '" & now()+0.5 & "', true)")
Set rsForums = nothing
'subtract post count
Conn.Execute("UPDATE [General] SET [NumPosts] = [NumPosts] - " & rsBBS("Replies")+1 & ", [NumTopics] = [NumTopics] - 1 WHERE TopicID = " & rsBBS("ParentForum"))
'add posts to new forum
Conn.Execute("UPDATE [General] SET [NumPosts] = [NumPosts] + " & rsBBS("Replies")+1 & ", [NumTopics] = [NumTopics] + 1 WHERE TopicID = " & Request("move"))
'move old thread to new forum
Conn.Execute("Update BBS Set ParentForum = " & Request("move") & ", ThreadPostTime = '" & now()+0.5 & "' WHERE ThreadID = " & Request("edit"))
rsBBS.close
end if
Set rsBBS = Conn.Execute("Select * from BBS Where ThreadID = " & Request("edit"))
%>
<html>
<head>
<title>LS Cinemax : Edit thread</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="o0m.css" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='edit.asp?Mode=Move&edit=<%=R equest("edit")%>&move="+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="3" cellspacing="1" class="tdBorder">
<tr class="tdLightest">
<td> <table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td align="center"><a href="ModEditThread.asp?Mode=Del&edit=<%=Request(" edit")%>&Forum=<%=forum%>"><img src="images/ModDelete.gif" alt="delete" border="0" align="absmiddle"></a></td>
<td align="center"><a href="ModEditThread.asp?Mode=sticky&edit=<%=Reques t("edit")%>&Forum=<%=forum%>"><img src="images/sticky.gif" alt="sticky" border="0" align="absmiddle"></a></td>
<td align="center"><a href="ModEditThread.asp?Mode=Move&edit=<%=Request( "edit")%>&Forum=<%=forum%>"><img src="images/ModMove.gif" alt="move" border="0" align="absmiddle"></a></td>
<td align="center"><a href="ModEditThread.asp?Mode=Split&edit=<%=Request ("edit")%>&Forum=<%=forum%>"><img src="images/ModSplit.gif" alt="split" border="0" align="absmiddle"></a></td>
<td align="center"><a href="ModEditThread.asp?Mode=Lock&edit=<%=Request( "edit")%>&Forum=<%=forum%>"><img src="images/ModLock.gif" alt="Lock / Unlock" border="0" align="absmiddle"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" class="tdLightest"> <% If rsBBS.EOF then %> <p> Record not found </p>
<% else
strMode = Request("Mode")
If strMode = "" then %> <p><strong>Thread options</strong></p>
<p>Click a link above to edit this thread </p>
<% Elseif strMode = "sticky" then
If rsBBS("STICKY") = true then x = false else x = true
Conn.Execute("UPDATE BBS SET Sticky = " & x & " WHERE ThreadID = " & edit)
if x = true then response.write "<p>Thread Made Sticky</p>" Else Response.Write "<p>Thread Made Not Sticky</p>"
ElseIf strMode = "Del" then %> <% if Request("Delete") <> "true" then %> <p><strong>Delete thread <%=rsBBS("Title")%>?</strong></p>
<p><a href="ModEditThread.asp?Mode=Del&delete=true&edit= <%=Request("edit")%>&Forum=<%=forum%>">yes</a>
| <a href="javascript:window.close()">no</a>
<% else %>
<% if Request("delete") = "true" then Conn.Execute("DELETE * FROM BBS WHERE ThreadID =" & Request("edit") & " OR ParentThread= " & Request("edit")) %>
<p>Thread deleted! post count not updated</p>
<% end if %></p>
<% ElseIf strMode = "Move" then %> <p><strong>Move thread to:</strong><br>
<select name="selForum" onChange="MM_jumpMenu('parent',this,0)">
<% Set rsForums = Conn.Execute("SELECT * From [General] Where [TopicHeader] = false ORDER BY TopicOrder ASC")
do while not rsForums.EOF %>
<option value="<%=rsForums("TopicID")%>"<% if rsBBS("ParentForum") = rsForums("TopicID") then %> selected<% end if %>><%=rsForums("ForumTitle")%></option>
<% rsForums.MoveNext
loop
rsForums.close %>
</select>
</p>
<% ElseIf strMode = "Lock" then
locked = rsBBS("Locked")
if locked = false then
Conn.Execute("UPDATE BBS SET Locked = true where ThreadID = " & Request("edit")) %> <p>Forum Locked</p>
<% else
Conn.Execute("UPDATE BBS SET Locked = false where ThreadID = " & Request("edit")) %> <p>Forum Unlocked</p>
<% end if
ElseIf strMode = "Split" then %> <p>coming...</p>
<% end if %> </td>
</tr>
<tr>
<td height="20" class="tdLightest"> <p align="center"><a href="javascript:window.close()">close
window</a></p></td>
</tr>
</table>
</body>
</html>
<% end if
rsBBS.close
Set Conn = nothing
%>
Error i got is page is missing and unfound but I do have those page exist..
|