Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 5th, 2004, 08:46 PM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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..


 
Old November 6th, 2004, 03:39 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

what is the error number Error 404 or 500?



Om Prakash
 
Old November 8th, 2004, 11:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Confirm that you are using the right URL to browse thos page and all the files that are involved in this page are located in its right path.

Try to use Response.write and Response.end at different lines from the top to find if any line has any error. I would suggest you to have just those two response codes in this file and try browsing it to see if you are able to see your response text. That way it would be easy to locate what is missing. Then add the original code and debug the same.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Error webnathan ASP.NET 1.0 and 1.1 Basics 9 November 6th, 2007 10:02 AM
Database error LJN BOOK: Beginning VB.NET Databases 1 July 24th, 2006 05:18 PM
error trying to open a database Boomer ASP.NET 1.0 and 1.1 Basics 2 June 22nd, 2003 01:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.