Author |
Topic |
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 19 February 2001 : 23:10:25
|
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
|
What's the error?
====== Doug G ====== |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 February 2001 : 05:02:33
|
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.
|
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 20 February 2001 : 12:53:36
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 February 2001 : 13:03:59
|
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
|
|
|
cevans
Junior Member
Canada
101 Posts |
Posted - 20 February 2001 : 13:12:15
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 February 2001 : 13:25:18
|
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.
|
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 20 February 2001 : 13:42:29
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 February 2001 : 13:45:35
|
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.
|
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 20 February 2001 : 13:47:03
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 February 2001 : 14:00:51
|
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.
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 29 January 2002 : 05:48:21
|
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 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 29 January 2002 : 06:19:14
|
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. |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 29 January 2002 : 06:53:50
|
agreed.. I changed it in my post above. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 29 January 2002 : 15:18:32
|
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. |
|
|
pweighill
Junior Member
United Kingdom
453 Posts |
Posted - 29 January 2002 : 15:46:29
|
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
|
|
|
|
Topic |
|