| Author |
Topic Search Topic Options
|
hawkmanva
Newbie
Joined: 25 July 2006
Status: Offline
Points: 13
|
Post Options
Thanks(0)
Quote Reply
Topic: Error on Batch Close 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
|
 |
Melkor
Groupie
Joined: 11 December 2006
Location: United States
Status: Offline
Points: 80
|
Post Options
Thanks(0)
Quote Reply
Posted: 18 January 2007 at 7:25am |
|
Any solution for this? I'm getting the error too, same line.
|
 |
dj air
Senior Member
Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
|
Post Options
Thanks(0)
Quote Reply
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
|
 |
Ali Bilgrami
Senior Member
Joined: 14 April 2005
Location: Pakistan
Status: Offline
Points: 492
|
Post Options
Thanks(0)
Quote Reply
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!
|
 |
pretty_witch
Newbie
Joined: 16 June 2006
Status: Offline
Points: 13
|
Post Options
Thanks(0)
Quote Reply
Posted: 05 February 2007 at 4:30pm |
|
Same error, SQL server... version 8.04
|
 |
MrMellie
Senior Member
Joined: 12 December 2006
Location: United Kingdom
Status: Offline
Points: 251
|
Post Options
Thanks(0)
Quote Reply
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.
Edited by MrMellie - 05 February 2007 at 4:56pm
|
 |
Ali Bilgrami
Senior Member
Joined: 14 April 2005
Location: Pakistan
Status: Offline
Points: 492
|
Post Options
Thanks(0)
Quote Reply
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!
|
 |
MrMellie
Senior Member
Joined: 12 December 2006
Location: United Kingdom
Status: Offline
Points: 251
|
Post Options
Thanks(0)
Quote Reply
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.
|
 |