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
 Edit Topic - SQL Error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 14 February 2005 :  16:57:32  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
Whenever I try to edit an topic (the first post), I get the 'no value given for one or more parameters'. This shows up when I try to edit a regular topic, as well as a poll. I suspect this has to do with the Message Icons MOD I installed, but I'm not sure how to fix it... The preceding lines of code (post_info) are as follows:

		'## Forum_SQL
		strSql = "UPDATE " & strActivePrefix & "TOPICS "
		strSql = strSql & " SET T_MESSAGE = '" & txtMessage & "'"
		strSql = strSql & ", T_SUBJECT = '" & txtSubject & "'"
		strSql = strSql & ", T_MSGICON = " & cLng(Request.Form("strMessageIcon"))
		if blnTopicMoved then
			strSql = strSql & ", CAT_ID = " & cLng(aryForum(0))
			strSql = strSql & ", FORUM_ID = " & cLng(aryForum(1))
			if AutoApprove = "Yes" then
				strSql = strSql & ", T_STATUS = 1 "
			end if
		end if
		if Request.Form("lockpoll") = "1" or ForumPolls = "0" then
			strSql = strSql & ", T_POLLSTATUS = 0"
		else
			strSql = strSql & ", T_POLLSTATUS = 1"
		end if
		if Request.Form("sig") = "yes" and strDSignatures = "1" then
		 	strSql = strSql & ", T_SIG = 1"
		else
			strSql = strSql & ", T_SIG = 0"
		end if
		if strEditedByDate = "1" then
		 if mLev = 4 then
			strSql = strSql & ", R_LAST_EDIT = '"  & DateToStr(strForumTimeAdjust) & "'"
			strSql = strSql & ", R_LAST_EDITBY = "  & IntAdminMemberID		 
		 else
			strSql = strSql & ", R_LAST_EDIT = '"  & DateToStr(strForumTimeAdjust) & "'"
			strSql = strSql & ", R_LAST_EDITBY = "  & MemberID
		 end if
		end if                                                  
		if ForumChkSkipAllowed = 1 then
			if Request.Form("sticky") = 1 then
				strSql = strSql & ", T_STICKY = " & 1
				strSql = strSql & ", T_ARCHIVE_FLAG = " & 0
			else
				strSql = strSql & ", T_STICKY = " & 0
				strSql = strSql & ", T_ARCHIVE_FLAG = " & 1
			end if
		end if
		strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

		my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords   <-- Error line

Edit: This should probably be in the MOD Implementation forum

Edited by - ruirib on 14 February 2005 17:26:54

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 15 February 2005 :  01:52:25  Show Profile  Visit Gremlin's Homepage
If you Add a Response.Write strSQL before the my_Conn.Execute(strSQL) you'll be able to see the error more easily. Come back with the output Query displayed and we should be able to fix it for you.

I suspect though it's probably this code here


		if ForumChkSkipAllowed = 1 then
			if Request.Form("sticky") = 1 then
				strSql = strSql & ", T_STICKY = " & 1
				strSql = strSql & ", T_ARCHIVE_FLAG = " & 0
			else
				strSql = strSql & ", T_STICKY = " & 0
				strSql = strSql & ", T_ARCHIVE_FLAG = " & 1
			end if
		end if

Try changing to

		if ForumChkSkipAllowed = 1 then
			if Request.Form("sticky") = 1 then
				strSql = strSql & ", T_STICKY = 1"
				strSql = strSql & ", T_ARCHIVE_FLAG = 0"
			else
				strSql = strSql & ", T_STICKY = 0"
				strSql = strSql & ", T_ARCHIVE_FLAG = 1"
			end if
		end if



Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 15 February 2005 :  19:58:12  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
Firstly, I tried the code change you suggested, but this didn't have any effect
quote:
Originally posted by Gremlin

If you Add a Response.Write strSQL before the my_Conn.Execute(strSQL) you'll be able to see the error more easily. Come back with the output Query displayed and we should be able to fix it for you.
This gives me the following output:

UPDATE FORUM_TOPICS SET T_MESSAGE = 'For those of you who do not know, Jorrit is the reason this forum is here and I just think he''s great! So, how great is he?', T_SUBJECT = 'How great is Jorrit?', T_MSGICON = 4, T_POLLSTATUS = 1, T_SIG = 1, R_LAST_EDIT = '20050216014947', R_LAST_EDITBY = 1, T_STICKY = 0, T_ARCHIVE_FLAG = 1 WHERE TOPIC_ID = 236

Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/post_info.asp, line 630


Thank you for your effort!

eXtremeGossip
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 16 February 2005 :  01:10:57  Show Profile  Visit Gremlin's Homepage
Ok, well in that case it sounds like perhaps you have a field in the database set to be non-null but the update isn't providing a value for that field. The query itself look to be at a quick glance well formed.

What other MOD's have you got installed? When did the error start happening?

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 16 February 2005 :  06:01:50  Show Profile  Visit TStewartFan's Homepage
Depending on how many values are being pulled a simple if else statement or a do while not null statement otta work. Set whatever and do while not null else the stuff after this:

set rs = my_Conn.Execute (strSql)
do while not rs.EOF
Your Stuff related to this code
rs.MoveNext
loop
rs.close
rs = Nothing

or a single value:

set rs = my_Conn.Execute (strSql)
mySubj = rs("T_SUBJECT") 'where you may have a null value
close.rs
rs = nothing

If mySubj <> 0 then
Your Stuff Here
Else You Nondependant sql stuff here

Play around with it a bit as a lot to do with sql is trial and error but one of those otta work.

If You Have to Ask, You Wouldn't Understand.
Go to Top of Page

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 16 February 2005 :  13:21:56  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
I checked the DB and the fields in the TOPICS table are these:

CAT_ID, FORUM_ID, TOPIC_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, T_SIG, T_ISPOLL, T_POLLSTATUS, T_MSGICON, T_MEMVIEWED

I've tried comparing the EditTopic code to the EditReply code, but I couldn't come up with anything... The only MODS that could be affecting this table are the Polls MOD, the Message Icons MOD and the Popup Topic Stats.

I am kinda reluctant to do what you suggested, TS, as I'm afraid it will undermine the functionality of my forum if I randomly insert Nulls where maybe there should be something else.
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 16 February 2005 :  15:03:05  Show Profile  Visit modifichicci's Homepage
It's missing the value of T_STATUS
You need this lines
if SecretAllowed = 1 and AdminAllowed = 1 then
if Request.Form("Secret") = "yes" then
strSql = strSql & ", T_STATUS = 11"
strSql = strSql & ", T_ARCHIVE_FLAG = 0"
else
strSql = strSql & ", T_STATUS = 1"
strSql = strSql & ", T_ARCHIVE_FLAG = 1"
end if
end if

just before
if strEditedByDate = "1" then
if mLev = 4 then
strSql = strSql & ", R_LAST_EDIT = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", R_LAST_EDITBY = " & IntAdminMemberID
else
strSql = strSql & ", R_LAST_EDIT = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", R_LAST_EDITBY = " & MemberID
end if
end if
The value of T_STATUS is searched but there is not in sql string.

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 16 February 2005 :  15:12:20  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
Adding the suggested code just gives me the same error, and moreover, this code doesn't appear in the original unedited post_info. But I agree that it could be in the T_STATUS thing.
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 16 February 2005 :  16:00:44  Show Profile  Visit modifichicci's Homepage
Yes I have write the code of my post info, that is modded...
But I think T_STATUS is the missing value

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 16 February 2005 :  16:16:43  Show Profile  Visit Gremlin's Homepage
Just look at each field in the database, exclude the ones you are inserting values for, and check the remaining ones to see if they have a default value specified in the database schema, if not then thats what your missing.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 17 February 2005 :  22:56:05  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
I have been giving this some more thought, and I've come to the conclusion that when updating the database, all records that need a value already have one (including the T_STATUS field). If not I would have gotten the error when posting a new topic. Correct me if I'm wrong...
Go to Top of Page

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 19 February 2005 :  11:38:35  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
I looked at the code again closely, and I noticed I was trying to insert R_LASTEDITBY into the TOPICS table... *slaps head*

eXtremeGossip
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.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07