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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 BUG+FIX (3.1sr5a7): On Error Resume Next
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 19 February 2001 :  23:10:25  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
Post.asp line #870

when it is removed it gives an error when adding a new FORUM. We need to figure out why and remove the "On Error Resume Next" from that line.

Reinsnitz (Mike)
><)))'>
"Therefore go and make disciples of all nations,..." Matthew 28:19a

Doug G
Support Moderator

USA
6493 Posts

Posted - 19 February 2001 :  23:24:34  Show Profile
What's the error?

======
Doug G
======
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 February 2001 :  05:02:33  Show Profile  Visit HuwR's Homepage
Ok, this is the deal, if you remove this line, you only get one list box
I have stuck error traps in it, but it does not display an err number or description, but without this line, it does'nt work.

There is nothing wrong with using the on error trap in this way, many programs use them in this way to trap unwanted errors.

Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 20 February 2001 :  12:53:36  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
ok... um... just checking :) I just wonder whats being done wrong (if anything) to caus the error.

Reinsnitz (Mike)
><)))'>
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 February 2001 :  13:03:59  Show Profile  Visit HuwR's Homepage
I really couldn't say, I spent a week trying to figur it out, but unless you put in the on error resume, it just doesn't do the secound list box, yet I can not get it to actually throw an error, yet another one of those weird phenomena

Go to Top of Page

cevans
Junior Member

Canada
101 Posts

Posted - 20 February 2001 :  13:12:15  Show Profile  Send cevans an ICQ Message
Is the line a database access line? And, if so, is it to SQL Server?

You might be getting warning messages (but not errors) back from the SQL Server if this is the case. I don't think these actually get put into the Err object. You would have to use the Connection.Errors collection to see them.


Clark
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 February 2001 :  13:25:18  Show Profile  Visit HuwR's Homepage
Ok, slap me around the face with a wet kipper.

I just realised what it's for.

the query which selects from allowed_users table needs an ID, when you create a new forum it does not have one, the on error is there so it skips it.

Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 20 February 2001 :  13:42:29  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
so.... to be politicaly correct... wouldn't we want to re-write the function to work with this situation? or write a new function?

Reinsnitz (Mike)
><)))'>
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 February 2001 :  13:45:35  Show Profile  Visit HuwR's Homepage
you would also have to rewrite all the references to the recordset aswell you could wrap the whole lot in a if rqForumID = "" then, but there is nothing wrong wth using error traps in this way.

Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 20 February 2001 :  13:47:03  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
just checking :) caus I know that these error traps use system resources ;) and if they can be circumvented... then it might be better? (please correct me there if I'm wrong)

Reinsnitz (Mike)
><)))'>
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 February 2001 :  14:00:51  Show Profile  Visit HuwR's Homepage
no, you are correct, since you are preventing a needles call to the db.

It is basically the stuff that refers to the allowed users recordset which needs wrapping in the if then, although the selct box should still appear.

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 29 January 2002 :  05:48:21  Show Profile
I change this code: (@ approximately line #886)

		strSql = "SELECT " & strTablePrefix & "ALLOWED_MEMBERS.MEMBER_ID "
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE " & strTablePrefix & "ALLOWED_MEMBERS.FORUM_ID = " & strRqForumID

set rsAllowedMember = my_Conn.execute (strSql)

tmpStrUserList = ""
if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
do while not (rsAllowedMember.EOF or rsAllowedMember.BOF)
if tmpStrUserList = "" then
tmpStrUserList = rsAllowedMember("MEMBER_ID")
else
tmpStrUserList = tmpStrUserList & "," & rsAllowedMember("MEMBER_ID")
end if
rsAllowedMember.movenext
loop
end if


to this:

		tmpStrUserList  = ""

if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
strSql = "SELECT " & strTablePrefix & "ALLOWED_MEMBERS.MEMBER_ID "
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE " & strTablePrefix & "ALLOWED_MEMBERS.FORUM_ID = " & strRqForumID

set rsAllowedMember = my_Conn.execute (strSql)

do while not (rsAllowedMember.EOF or rsAllowedMember.BOF)
if tmpStrUserList = "" then
tmpStrUserList = rsAllowedMember("MEMBER_ID")
else
tmpStrUserList = tmpStrUserList & "," & rsAllowedMember("MEMBER_ID")
end if
rsAllowedMember.movenext
loop
end if



then I changed this code: (@ approximately line #929)

		rsAllowedMember.movefirst
if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
do until rsAllowedMember.EOF
if rsAllowedMember("MEMBER_ID") <> "" then
Response.Write " <option value=""" & rsAllowedMember("MEMBER_ID") & """>" & ChkString(getMemberName(rsAllowedMember("MEMBER_ID")),"display") & "</option>" & vbNewline
end if
rsAllowedMember.movenext
loop
end if
set rsAllowedMember = nothing


to this:

		if strRqMethod = "EditForum" or strRqMethod = "EditURL" then	
if not(rsAllowedMember.bof or rsAllowedMember.eof) then
rsAllowedMember.movefirst
do until rsAllowedMember.EOF
if rsAllowedMember("MEMBER_ID") <> "" then
Response.Write " <option value=""" & rsAllowedMember("MEMBER_ID") & """>" & ChkString(getMemberName(rsAllowedMember("MEMBER_ID")),"display") & "</option>" & vbNewline
end if
rsAllowedMember.movenext
loop
end if
set rsAllowedMember = nothing
end if



and it doesn't give an error when commenting out the on error resume next line now.

fixed in v3.4
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 29 January 2002 :  06:19:14  Show Profile
Richard, You might consider doing it this way

 
if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
if not(rsAllowedMember.bof) or not(rsAllowedMember.eof) then
rsAllowedMember.movefirst
do until rsAllowedMember.EOF
if rsAllowedMember("MEMBER_ID") <> "" then
Response.Write " <option value=""" & rsAllowedMember("MEMBER_ID") & """>" & ChkString(getMemberName(rsAllowedMember("MEMBER_ID")),"display") & "</option>" & vbNewline
end if
rsAllowedMember.movenext
loop
end if
set rsAllowedMember = nothing
end if



K

www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 29 January 2002 :  06:53:50  Show Profile
agreed.. I changed it in my post above.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 29 January 2002 :  15:18:32  Show Profile
post.asp (@ Lines 926-938)


<select name="AuthUsersCombo" size="<%=SelectSize %>" multiple onDblClick="moveSelectedOptions(document.PostTopic.AuthUsersCombo, document.PostTopic.AuthUsers, false, '')">
<%'## Pick from list
rsMember.movefirst
do until rsMember.eof
if not(Instr("," & tmpStrUserList & "," , "," & rsMember("MEMBER_ID") & ",",1) > 0) then
Response.Write "<option value=""" & rsMember("MEMBER_ID") & """" & isSel & ">" & ChkString(rsMember("M_NAME"),"display") & "</option>" & vbNewline
end if
rsMember.movenext
loop
if tmpStrUserList <> "" then
%> <option value="<% =tmpStrUserList %>"></option>
<% end if %>

</select>


I am not sure if the statements in red are still part of the code or what exactly they do. I do not have those statements in my file and the allowed members feature works okay.



However Here is a suggestion for the above block of code. When there are no members in the Allowed List then there is no need to use Instr(......) for every member



<select name="AuthUsersCombo" size="<%=SelectSize %>" multiple onDblClick="moveSelectedOptions(document.PostTopic.AuthUsersCombo, document.PostTopic.AuthUsers, false, '');sortSelect(document.PostTopic.AuthUsers)">
rsMember.movefirst
if tmpStrUserList = "" then
do until rsMember.eof
Response.Write "<option value=""" & rsMember("MEMBER_ID") & """" & isSel & ">" & ChkString(rsMember("M_NAME"),"display") & "</option>" & vbNewline
rsMember.movenext
loop
else
do until rsMember.eof
if not(Instr("," & tmpStrUserList & "," , "," & rsMember("MEMBER_ID") & ",") > 0) then
Response.Write "<option value=""" & rsMember("MEMBER_ID") & """" & isSel & ">" & ChkString(rsMember("M_NAME"),"display") & "</option>" & vbNewline
end if
rsMember.movenext
loop
end if
%>
</select>


www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 29 January 2002 :  15:46:29  Show Profile
You could change:
		tmpStrUserList  = ""

if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
strSql = "SELECT " & strTablePrefix & "ALLOWED_MEMBERS.MEMBER_ID "
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE " & strTablePrefix & "ALLOWED_MEMBERS.FORUM_ID = " & strRqForumID

set rsAllowedMember = my_Conn.execute (strSql)

do while not (rsAllowedMember.EOF or rsAllowedMember.BOF)
if tmpStrUserList = "" then
tmpStrUserList = rsAllowedMember("MEMBER_ID")
else
tmpStrUserList = tmpStrUserList & "," & rsAllowedMember("MEMBER_ID")
end if
rsAllowedMember.movenext
loop
end if


to this:
		tmpStrUserList  = ""

if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
strSql = "SELECT MEMBER_ID "
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE FORUM_ID = " & strRqForumID


set rsAllowedMember = my_Conn.execute (strSql)

do until rsAllowedMember.EOF
if tmpStrUserList = "" then
tmpStrUserList = rsAllowedMember("MEMBER_ID")
else
tmpStrUserList = tmpStrUserList & "," & rsAllowedMember("MEMBER_ID")
end if
rsAllowedMember.movenext
loop
end if


which is slightly less code

Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07