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
 Random Usergroups error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Webbo
Average Member

United Kingdom
982 Posts

Posted - 05 December 2008 :  18:04:02  Show Profile  Visit Webbo's Homepage
Occasionally when members of a Usergroup are posting to a forum which only allows that usergroup permission to view the following error shows:

quote:
ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/forum/inc_func_common.asp, line 1706



Line 1706 is:

blnAllowed = 0
         Do While Not rsAllowedUserGroups.eof Or OldisAllowedMember <> 1
 Line 1706     intUserGroupID = rsAllowedUserGroups("USERGROUP_ID")
            if InStr("," & strGroupsForUser & ",", "," & intUserGroupID & ",") then OldisAllowedMember = 1
            rsAllowedUserGroups.movenext
         Loop
         rsAllowedUserGroups.close
         set rsAllowedUserGroups = nothing
      end if


The post is still made but instead of being directed to the thankyou message the poster sees the error

Any ideas?

(MySql database)<

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 05 December 2008 :  18:53:26  Show Profile  Send ruirib a Yahoo! Message


         Do While Not rsAllowedUserGroups.eof Or OldisAllowedMember <> 1

Not knowing the code, I would almost bet you're problem lies here, because you may have [b]OldisAllowedMember[/red] <> 1 and no records in rsAllowedUserGroups, but this is just a guess...

So is this code from the mod or was it changed by someone?<


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

Webbo
Average Member

United Kingdom
982 Posts

Posted - 05 December 2008 :  19:36:04  Show Profile  Visit Webbo's Homepage
That's the code from the mod

The full code for that function is:

function OldisAllowedMember(fForum_ID,fMemberID)
   OldisAllowedMember = 0
   if isDeniedMember(fForum_ID, fMemberID) then exit function
   strSql = "SELECT MEMBER_ID, FORUM_ID FROM " & strTablePrefix & "ALLOWED_MEMBERS "
   strSql = strSql & " WHERE FORUM_ID = " & cLng(fForum_ID)
   strSql = strSql & " AND MEMBER_ID = " & cLng(fMemberID)

   Set rsAllowedMember = Server.CreateObject("ADODB.Recordset")
   rsAllowedMember.open strSql, my_Conn
   blnAM = 0
   if not rsAllowedMember.bof and not rsAllowedMember.eof then blnAM = 1
   rsAllowedMember.close
   set rsAllowedMember = nothing

   '## if the member exists as an allowed member for the forum then return value 1
   if blnAm = 1 then
      OldisAllowedMember = 1
   else

      '## check for usergroup membership
      strGroupsForUser = getGroupMembership(fMemberID,1)
      if strGroupsForUser <> "" then
         '## check to see if the user's groups are a part of this forum
         strSql = "SELECT USERGROUP_ID FROM " & strTablePrefix & "ALLOWED_USERGROUPS "
         strSql = strSql & "WHERE FORUM_ID = " & fForum_ID
         strSql = strSql & " AND PERMS = 0"
         set rsAllowedUserGroups = my_Conn.execute(strSql)

         blnAllowed = 0
         Do While Not rsAllowedUserGroups.eof Or OldisAllowedMember <> 1
            intUserGroupID = rsAllowedUserGroups("USERGROUP_ID")
            if InStr("," & strGroupsForUser & ",", "," & intUserGroupID & ",") then OldisAllowedMember = 1
            rsAllowedUserGroups.movenext
         Loop
         rsAllowedUserGroups.close
         set rsAllowedUserGroups = nothing
      end if
   end if
end function
<

Edited by - Webbo on 05 December 2008 19:37:58
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 05 December 2008 :  21:51:48  Show Profile
On line 1705, change it to say:

Do While Not (rsAllowedUserGroups.eof or rsAllowedUserGroups.BOF) Or OldisAllowedMember <> 1
<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 05 December 2008 :  23:17:16  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by Carefree

On line 1705, change it to say:

Do While Not (rsAllowedUserGroups.eof or rsAllowedUserGroups.BOF) Or OldisAllowedMember <> 1



This won't work, because the loop won't stop until oldisAllowedMember is 1.

Webbo, try this function version:


function OldisAllowedMember(fForum_ID,fMemberID)
   OldisAllowedMember = 0
   if isDeniedMember(fForum_ID, fMemberID) then exit function
   strSql = "SELECT MEMBER_ID, FORUM_ID FROM " & strTablePrefix & "ALLOWED_MEMBERS "
   strSql = strSql & " WHERE FORUM_ID = " & cLng(fForum_ID)
   strSql = strSql & " AND MEMBER_ID = " & cLng(fMemberID)

   Set rsAllowedMember = Server.CreateObject("ADODB.Recordset")
   rsAllowedMember.open strSql, my_Conn
   blnAM = 0
   if not rsAllowedMember.bof and not rsAllowedMember.eof then blnAM = 1
   rsAllowedMember.close
   set rsAllowedMember = nothing

   '## if the member exists as an allowed member for the forum then return value 1
   if blnAm = 1 then
      OldisAllowedMember = 1
   else

      '## check for usergroup membership
      strGroupsForUser = getGroupMembership(fMemberID,1)
      if strGroupsForUser <> "" then
         '## check to see if the user's groups are a part of this forum
         strSql = "SELECT USERGROUP_ID FROM " & strTablePrefix & "ALLOWED_USERGROUPS "
         strSql = strSql & "WHERE FORUM_ID = " & fForum_ID
         strSql = strSql & " AND PERMS = 0"
         set rsAllowedUserGroups = my_Conn.execute(strSql)

         blnAllowed = 0
	 continueLoop = Not rs.AllowedUserGroups.eof 

         Do While continueLoop
            intUserGroupID = rsAllowedUserGroups("USERGROUP_ID")
            if InStr("," & strGroupsForUser & ",", "," & intUserGroupID & ",") then OldisAllowedMember = 1
            rsAllowedUserGroups.movenext

	    continueLoop = Not rs.AllowedUserGroups.eof 

	    If OldisAllowedMember = 1
		continueLoop = false 
	    End If 
         Loop
         rsAllowedUserGroups.close
         set rsAllowedUserGroups = nothing
      end if
   end if
end function
<


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

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 06 December 2008 :  00:32:15  Show Profile
One tiny error, Ruirib, add the bit in red.

	    If OldisAllowedMember = 1 then
		continueLoop = false 
	    End If 
         Loop
         rsAllowedUserGroups.close
         set rsAllowedUserGroups = nothing
      end if
   end if
end function
<
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 06 December 2008 :  03:16:14  Show Profile  Visit Webbo's Homepage
Hi Ruirib,

That code (with 'then' added) returns an error:

quote:
Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'rs.AllowedUserGroups'

/forum/inc_func_common.asp, line 1705

<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 06 December 2008 :  07:40:14  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by Webbo

Hi Ruirib,

That code (with 'then' added) returns an error:

quote:
Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'rs.AllowedUserGroups'

/forum/inc_func_common.asp, line 1705




What line is that?<


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

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 06 December 2008 :  07:54:16  Show Profile  Visit HuwR's Homepage
I think the problem is that you defined the rs as
rsAllowedUserGroups but are then incorrectly referring to it as Not rs.AllowedUserGroups<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 06 December 2008 :  08:03:48  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by HuwR

I think the problem is that you defined the rs as
rsAllowedUserGroups but are then incorrectly referring to it as Not rs.AllowedUserGroups


You are right Huw, that's precisely it. Thanks.<


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

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 06 December 2008 :  08:05:10  Show Profile  Send ruirib a Yahoo! Message
Webbo, here is the fixed code:

function OldisAllowedMember(fForum_ID,fMemberID)
   OldisAllowedMember = 0
   if isDeniedMember(fForum_ID, fMemberID) then exit function
   strSql = "SELECT MEMBER_ID, FORUM_ID FROM " & strTablePrefix & "ALLOWED_MEMBERS "
   strSql = strSql & " WHERE FORUM_ID = " & cLng(fForum_ID)
   strSql = strSql & " AND MEMBER_ID = " & cLng(fMemberID)

   Set rsAllowedMember = Server.CreateObject("ADODB.Recordset")
   rsAllowedMember.open strSql, my_Conn
   blnAM = 0
   if not rsAllowedMember.bof and not rsAllowedMember.eof then blnAM = 1
   rsAllowedMember.close
   set rsAllowedMember = nothing

   '## if the member exists as an allowed member for the forum then return value 1
   if blnAm = 1 then
      OldisAllowedMember = 1
   else

      '## check for usergroup membership
      strGroupsForUser = getGroupMembership(fMemberID,1)
      if strGroupsForUser <> "" then
         '## check to see if the user's groups are a part of this forum
         strSql = "SELECT USERGROUP_ID FROM " & strTablePrefix & "ALLOWED_USERGROUPS "
         strSql = strSql & "WHERE FORUM_ID = " & fForum_ID
         strSql = strSql & " AND PERMS = 0"
         set rsAllowedUserGroups = my_Conn.execute(strSql)

         blnAllowed = 0
	 continueLoop = Not rsAllowedUserGroups.eof 

         Do While continueLoop
            intUserGroupID = rsAllowedUserGroups("USERGROUP_ID")
            if InStr("," & strGroupsForUser & ",", "," & intUserGroupID & ",") then OldisAllowedMember = 1
            rsAllowedUserGroups.movenext

	    continueLoop = Not rsAllowedUserGroups.eof 

	    If OldisAllowedMember = 1 Then
		continueLoop = false 
	    End If 
         Loop
         rsAllowedUserGroups.close
         set rsAllowedUserGroups = nothing
      end if
   end if
end function
<


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

Webbo
Average Member

United Kingdom
982 Posts

Posted - 06 December 2008 :  12:25:11  Show Profile  Visit Webbo's Homepage
Excellent, works a treat

Many thanks once again

Edit: PS, I've just dropped a few Dollars into the kitty, it's well worth it for the support I've received <

Edited by - Webbo on 06 December 2008 12:36:50
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 06 December 2008 :  15:39:54  Show Profile  Send ruirib a Yahoo! Message
Great .<


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

Etymon
Advanced Member

United States
2385 Posts

Posted - 07 December 2008 :  01:54:52  Show Profile  Visit Etymon's Homepage
Thanks guys for the support on this MOD! <
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.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07