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
 Sub Forum Error Message
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MaGraham
Senior Member

USA
1297 Posts

Posted - 03 July 2012 :  06:03:36  Show Profile  Reply with Quote
After completing the "Sub-Forum Mod" I get the following error message when attempting to create a new forum. Any clues?


Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = 0' at line 1

/tfp/post.asp, line 674



Here are lines 669 - 679 from my post.asp.



"<td bgColor=""" & strPopupTableColor & """>" & vbNewLine
'Forum Parent!
'Find out if this forum is a sub-forum!
If strRqForumID = "" Then strRqForumID = 0
strSQL = "SELECT TOP 1 F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = " & strRqForumID
set rsFindSub = my_Conn.Execute(strSQL)
if rsFindSub.eof then
strSubForum = NULL
else
strSubForum = rsFindSub("F_PARENT")
end if



I am also including a link to my entire post.asp in txt format.



post.asp in txt format


Any help would be Soooo greatly appreciated!



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 03 July 2012 06:04:41

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 03 July 2012 :  06:40:45  Show Profile  Send ruirib a Yahoo! Message
Replace this line:

strSQL = "SELECT TOP 1 F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = " & strRqForumID

by

strSQL = "SELECT F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = " & strRqForumID & " LIMIT 1"


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

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 03 July 2012 :  07:36:01  Show Profile
Or use the "TopSQL" function found in inc_func_common.asp so you don't have to worry about changing it again should you ever change the type of database you're using:
strSql=TopSQL("SELECT F_PARENT FROM FORUM_FORUM WHERE FORUM_ID="&strRqForumID,1)

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 03 July 2012 :  10:57:06  Show Profile
quote:
Originally posted by Shaggy

Or use the "TopSQL" function found in inc_func_common.asp so you don't have to worry about changing it again should you ever change the type of database you're using:
strSql=TopSQL("SELECT F_PARENT FROM FORUM_FORUM WHERE FORUM_ID="&strRqForumID,1)




I think I like the idea of this one! Where is this located in the inc_func_common file, Shaggy?




"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 03 July 2012 :  17:34:11  Show Profile
It's this routine:


'## Function to limit the amount of records to retrieve from the database
Function TopSQL(strSQL, lngRecords)
	if ucase(left(strSQL,7)) = "SELECT " then
 		select case strDBType 
			case "sqlserver"
				TopSQL = "SET ROWCOUNT " & lngRecords & vbNewLine & strSQL & vbNewLine & "SET ROWCOUNT 0"
			case "access"
				TopSQL = "SELECT TOP " & lngRecords & mid(strSQL,7)
			case "mysql"
				if instr(strSQL,";") > 0 then
					strSQL1 = Mid(strSQL, 1, Instr(strSQL, ";")-1)
					strSQL2 = Mid(strSQL, InstrRev(strSQL, ";"))
					TopSQL = strSQL1 & " LIMIT " & lngRecords & strSQL2
				else
					TopSQL = strSQL & " LIMIT " & lngRecords
				end if
		end select
	else
		TopSQL = strSQL
	end if
End Function
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 04 July 2012 :  05:41:37  Show Profile


WONDERFUL! Thank you so much, Carefree!

I Sooooo appreciate you guys!



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07