Author |
Topic |
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 05 December 2008 : 18:04:02
|
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
|
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 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 05 December 2008 : 19:36:04
|
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 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 05 December 2008 : 21:51:48
|
On line 1705, change it to say:
Do While Not (rsAllowedUserGroups.eof or rsAllowedUserGroups.BOF) Or OldisAllowedMember <> 1 < |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 05 December 2008 : 23:17:16
|
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 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 06 December 2008 : 00:32:15
|
One tiny error, Ruirib, add the bit in red.
< |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 06 December 2008 : 03:16:14
|
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
< |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 06 December 2008 : 07:40:14
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 06 December 2008 : 07:54:16
|
I think the problem is that you defined the rs as rsAllowedUserGroups but are then incorrectly referring to it as Not rs.AllowedUserGroups< |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 06 December 2008 : 08:03:48
|
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 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 06 December 2008 : 08:05:10
|
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 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 06 December 2008 : 12:25:11
|
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 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 07 December 2008 : 01:54:52
|
Thanks guys for the support on this MOD! < |
|
|
|
Topic |
|