Print Page | Close Window

Error on Batch Close

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21780
Printed Date: 28 March 2026 at 5:59pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Error on Batch Close
Posted By: hawkmanva
Subject: Error on Batch Close
Date Posted: 30 October 2006 at 1:00am
I get this error when I try to do a batch close on old messages older than 1 month.
 
 
 Microsoft OLE DB Provider for SQL Server error '80040e14'

Incorrect syntax near ','.

/forum/admin_archive_topics.asp, line 107




Replies:
Posted By: Melkor
Date Posted: 18 January 2007 at 7:25am
Any solution for this? I'm getting the error too, same line.


Posted By: dj air
Date Posted: 18 January 2007 at 3:24pm
please noite this was pasted in the wrong forum,
 
i have now moved this topic.
 
please try re uploading the files
 
this issue will be investigated


Posted By: Ali Bilgrami
Date Posted: 29 January 2007 at 1:36pm

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near ','.

/forum2/admin_archive_topics.asp, line 89

same error here...and i am using an SQL Server DB...what is causing this?

-------------
Lets!


Posted By: pretty_witch
Date Posted: 05 February 2007 at 4:30pm
Same error, SQL server... version 8.04

-------------
What you believe is what you live.


Posted By: MrMellie
Date Posted: 05 February 2007 at 4:55pm
On an empty line, 104 or thereabouts for v8.04 or 86 for v8.05, put in response.write strSQL and rerun the page. You should get a SQL string displayed. It should hopefully be possible to spot any error in the SQL command that is being executed.


Posted By: Ali Bilgrami
Date Posted: 05 February 2007 at 8:26pm
UPDATE tblTopic, tblThread SET tblTopic.Locked = 1 WHERE (tblTopic.Last_Thread_ID = tblThread.Thread_ID) AND (tblThread.Message_date < '20070122 14:26:00') AND (tblTopic.Forum_ID = 1) ;
 
this is what I got after puting the response.write strSQL
 
 


-------------
Lets!


Posted By: MrMellie
Date Posted: 06 February 2007 at 10:08am
Hmmmm well yeah, I wouldn't expect that to work, it's invalid SQL syntax for a SQL Server UPDATE statement. You can't list multiple tables immediately after the UPDATE command. If you want to do an update based on the values in other tables, the sytnax for MS SQL is:

UPDATE tblTopic

SET tblTopic.Locked = 1
FROM tblTopic, tblThread
WHERE (tblTopic.Last_Thread_ID = tblThread.Thread_ID)
AND (tblThread.Message_date < '20070122 14:26:00')
AND (tblTopic.Forum_ID = 1) ;


I guess it was never tested on MS SQL. To fix it, find the code that says:

'Initalise the strSQL variable with an SQL statement to get the topic from the database

    If blnClose Then
         strSQL = "UPDATE " & strDbTable & "Topic, " & strDbTable & "Thread SET " & strDbTable & "Topic.Locked = " & strDBTrue & " "

    ElseIf blnClose = false Then
         strSQL = "UPDATE " & strDbTable & "Topic, " & strDbTable & "Thread SET " & strDbTable & "Topic.Locked = " & strDBFalse & " "
    End If


and replace it with:


'Initalise the strSQL variable with an SQL statement to get the topic from the database
if strDatabaseType="SQLServer" then
    If blnClose Then
         strSQL = "UPDATE " & strDbTable & "Topic SET " & strDbTable & "Topic.Locked = " & strDBTrue & " "

    ElseIf blnClose = false Then
         strSQL = "UPDATE " & strDbTable & "Topic SET " & strDbTable & "Topic.Locked = " & strDBFalse & " "
    End If
    strSQL=strSQL & "FROM " & strDbTable & "Topic, " & strDbTable & "Thread "
else
    If blnClose Then
         strSQL = "UPDATE " & strDbTable & "Topic, " & strDbTable & "Thread SET " & strDbTable & "Topic.Locked = " & strDBTrue & " "

    ElseIf blnClose = false Then
         strSQL = "UPDATE " & strDbTable & "Topic, " & strDbTable & "Thread SET " & strDbTable & "Topic.Locked = " & strDBFalse & " "
    End If
end if


I haven't been able to test that (Captcha is screwed on this PC) but I think it should be ok.


Posted By: Ali Bilgrami
Date Posted: 06 February 2007 at 11:10pm
worked flawlessly...thanks mate

-------------
Lets!


Posted By: MrMellie
Date Posted: 07 February 2007 at 12:58am
My pleasure.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net