Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 pm_delete.asp Incorrect syntax near ')'.
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

spreadpoems
New Member

52 Posts

Posted - 09 November 2009 :  10:55:54  Show Profile
Hi

I am using Snitz Forums 2000 Version 3.4.06

I log all 500 errors on my forum. I've been seeing this error about once or twice a month for the past few months. I have the private message mod installed.

The page is pm_delete.asp.

The error is
Microsoft OLE DB Provider for SQL Server
/pm_delete.asp Line 98
Incorrect syntax near ')'.

I have tried to duplicate the error without success.
Line 98 is: my_Conn.Execute (strSql)
(in large red font below.)



<%
'#################################################################################
'## Copyright (C) 2000-01 Michael Anderson, Pierre Gorissen
'##                       Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to 
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com 
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
'##       Part of the Private Messages MOD for Snitz Forums 2000 v3.4.04        ##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" --> 
<!--#INCLUDE FILE="inc_func_common.asp" --> 
<!--#INCLUDE FILE="inc_header.asp" -->
<%
if Request.Form("RemoveTopic") = "1" then
	Dim strRemoveList
	strRemoveList = ChkString(Request("Remove"),"SQLString")

	if strRemoveList = "" then
		'No messages to remove
		Response.Write	"<center>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>You did not select any messages!</font></p>" & vbNewLine & _
				"<P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><a href=""pm_view.asp"">Return to your Inbox.</a></b></font></p>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"</center>" & vbNewLine
	else
		'Now, use the SQL set notation to Remove all of the records
		'specified by strRemoveList
		strSql = "UPDATE " & strTablePrefix & "PM " & _
			 "SET " & strTablePrefix & "PM.M_OUTBOX = 0 " & _
			 "WHERE M_ID IN (" & strRemoveList & ")"

		my_Conn.Execute (strSql)

		Response.Write	"<center>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & Request("Remove").Count & " message(s) were removed!</font></p>" & vbNewLine & _
				"<P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><a href=""pm_view.asp"">Return to your Inbox.</a></b></font></p>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"</center>" & vbNewLine
	end if
else
	Dim strDeleteList
		strDeleteList = ChkString(Request("Delete"),"SQLString")

	if strDeleteList = "" then
		'No messages to delete
		Response.Write	"<center>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>You did not select any messages!</font></p>" & vbNewLine & _
				"<P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><a href=""pm_view.asp"">Return to your Inbox.</a></b></font></p>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"</center>" & vbNewLine
	else
		'Now, use the SQL set notation to delete all of the records
		'specified by strDeleteList
		strSql = "DELETE FROM " & strTablePrefix & "PM " & _
				 "WHERE M_ID IN (" & strDeleteList & ")"

		my_Conn.Execute (strSql)

		Response.Write	"<center>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & Request("Delete").Count & " Message(s) were deleted!</font></p>" & vbNewLine & _
				"<P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><a href=""pm_view.asp"">Return to your Inbox.</a></b></font></p>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"<br>" & vbNewLine & _
				"</center>" & vbNewLine
	end if
end if
Response.Write "<br>" & vbNewLine
WriteFooter
%>


Any help would be appreciated Thanks!

Edited by - AnonJr on 09 November 2009 13:09:06

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 09 November 2009 :  17:55:57  Show Profile  Visit HuwR's Homepage
the error most likely indicates that strDeleteList is somehow wrong but no idea why
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 10 November 2009 :  10:00:37  Show Profile  Send ruirib a Yahoo! Message
Probably someone clicked the Delete button without any pm selected for deletion.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

spreadpoems
New Member

52 Posts

Posted - 10 November 2009 :  14:08:54  Show Profile
quote:
Probably someone clicked the Delete button without any pm selected for deletion.


Thanks. You are right. I was able to duplicate the error by clicking the delete button on pm_view.asp without selecting any messages. The form is then submitted to pm_delete.asp where the error occurs

Now how to fix it.

If Request("Delete") is blank so then why isn't it caught by the if statement at the bottom of pm_delete.asp

	Dim strDeleteList
		strDeleteList = ChkString(Request("Delete"),"SQLString")

	if strDeleteList = "" then
		'No messages to delete
		Response.Write......



It should never get to the else statement which is causing the error

	else
		'Now, use the SQL set notation to delete all of the records
		'specified by strDeleteList
		strSql = "DELETE FROM " & strTablePrefix & "PM " & _
				 "WHERE M_ID IN (" & strDeleteList & ")"

		my_Conn.Execute (strSql)


Go to Top of Page

spreadpoems
New Member

52 Posts

Posted - 10 November 2009 :  14:20:19  Show Profile
ok I think i got it
changed it to
if strDeleteList = " " then

instead of
if strDeleteList = "" then

apparently the chkString function returns a empty space " "

function chkString(pString,fField_Type)
fString = trim(pString)
if fString = "" or isNull(fString) then
fString = " "

Also just this post
http://forum.snitz.com/Forum/topic.asp?ARCHIVE=true&TOPIC_ID=66202

Edited by - spreadpoems on 10 November 2009 14:24:12
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07