Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
ASPProtect Full 7.x Support (Info Locked Info Locked)
 CJWSoft Support Info : ASPProtect Full 7.x Support
Subject Info: Using Groups to select A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
DonP
New User
New User


Joined: September/02/2004
Location: United States
Online Status: Offline
Info: 7
Added: April/14/2007 at 1:55am | IP Logged Quote DonP

Chris:

 

I am fairly new to ASPProtect v.7 and am learning how to use Groups rather than Access_Level. I have reviewed the documentation and found a page with examples for selecting with Groups:

 

<%
If InStr(Session("Groups"),"*9*") Then
     Response.Write("You are a member of group 9")
End If
%>

 

My project is to identify the military bases and casualties members of an Air Force veterans association served at during the Vietnam War.

 

1.  When I use the below ACCESS_LEVELs to select member’s status and info it works just fine for all 2,000 members. (Login with Username: Temp  PW: Temp http://www.vspa.com/aspprotect/guardmount-vspa-ad-2-access.a sp).

 

Code for Access_Level:

<!-- SELECT: VSPA MEMBERS & CASUALTIES, A-D -->

<!-- Group *9999* is non existing and permits selection to fall through and test multiple ElseIf Statements -->

<!-- Group *91* is assigned to select Names A-D  -->

 

<% If InStr(Session("Groups"),"*9999*") Then %>

             <% ElseIf CmdListUsers("Access_Level") = "1" THEN %>

<!-- DISPLAY KIA-LOD Names A-D and Icons -->

 

2.  When I use the below Groups to select member’s status and info, it does not select anything at all.  (Login with Username: Temp  PW: Temp  http://www.vspa.com/aspprotect/guardmount-vspa-ad-2-groups.a sp).

 

Codes for Groups Numbers:

<!-- SELECT: VSPA MEMBERS & CASUALTIES, A-D -->

<!-- Group *9999* is non existing and permits selection to fall through and test multiple Else If Statements -->

<!-- Group *91* is assigned to select Names A-D  -->

 

<% If InStr(Session("Groups"),"*9999*") Then %>

<% ElseIf InStr(Session("Groups"),"*91*") THEN %>

<!-- DISPLAY KIA-LOD Names A-D and Icons -->

 

Obviously I do not yet understand how to use Groups as I would an Access_Level (using “If Then Else”) throughout to select qualifying members.

 

Your advice will be greatly appreciated.

 

Don Poss



__________________
Don Poss
Back to Top View DonP's Profile Search for other info by DonP Visit DonP's Homepage
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1769
Added: April/15/2007 at 1:03am | IP Logged Quote cwilliams

this is very cornfusing

__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 
DonP
New User
New User


Joined: September/02/2004
Location: United States
Online Status: Offline
Info: 7
Added: April/15/2007 at 3:29am | IP Logged Quote DonP

Chris:

Sorry'bout that. I wanted to provide an adequate amount of info. Let me try a simpler way:

With ASPProtect v6 I used Access_Levels like a light switch to test whether or not a field's contents qualified for what I was looking for. I used If Then Else logic (If Access_Level "1" = 0 Then, do whatever).

I want to do the same thing (IF then else) with Groups, if possible. Your examples show how to see if a record has the Group number you are looking for. But I cannot find an example in the documentation on how to check if a Group is = > <> < than the Group(s) I am looking for.

This is very important to me, and if I missed an area in the documentation or on the Forum, please point me there. Your help is greatly appreciated.

Don Poss



__________________
Don Poss
Back to Top View DonP's Profile Search for other info by DonP Visit DonP's Homepage
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1769
Added: April/15/2007 at 3:35am | IP Logged Quote cwilliams

<% If InStr(Session("Groups"),"*9*") = 0 Then %>

That is an example which I think would do what you just asked.
Below is another way to do it which I think would also work.

<% If Not(InStr(Session("Groups"),"*9*")Then %>

It just vbscript function logic sorta stuff really..



__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1769
Added: April/15/2007 at 3:44am | IP Logged Quote cwilliams

actually.. I am not sure if the 2nd example is right..

I think ya got to do it like the 1st example I showed based on how InStr works.

http://www.powerasp.com/content/new/function-reference-34.ht m

__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 
DonP
New User
New User


Joined: September/02/2004
Location: United States
Online Status: Offline
Info: 7
Added: April/20/2007 at 12:50am | IP Logged Quote DonP

Chris:  I am still trying to select records based on Groups number and, IF qualified, THEN post online in a report. It will be a great day when I discover, or find out, how to use Groups like Access_Levels to select records. If anyone out there uses the contents of Groups to select records for If Then Else type logic, please post an example of how you do it.

 

I have researched online and, tried the two posted above, and the following without success:

 

<% If CmdListUsers("Groups") = "*3*" Then %>

 

<% If Not(InStr(Session("Groups"),"*3*")) Then %>

<% If CmdListUsers("Groups") = "3" Then %>

 

<% If InStr(Session("Groups"),"*3*") Then %>

<% If InStr(Session("Groups"),"*3*") = 0 Then %>

<% If InStr(Session("Groups") = "*3*") Then %>

 

<% If InStr(Start, Groups, *3*) Then %>

 

<% If InStr(Groups,"*3*") = 0 Then %>

<% If InStr(Groups,"*11*") = 0 Then %>

<% If InStr(1,”Groups”, strLook,*3*) Then %>

<% If InStr(1, Groups, strName, 3) > 0 Then %>

<% If InStr(CmdEditGroup("Group_Name"),"*11*") Then %>

 

<% If Session("GROUPACCESS") = "*9*"  Then %>

 

<% If CmdListUsers("GROUPACCESS") = "*3*" Then %>

 

<% If CmdGetGroups("Group_ID") = "*3*" Then %>

<% If CmdGetGroups("Group_ID") = "9" Then %>

 

<% If CmdGetGroups("Group_Name") = "3 Bien Hoa - BH" Then %>

<% If CmdListUsers("Group_Name") = "3 Bien Hoa - BH" Then %>

 

<% If (Group_ID = " & 3 Bien Hoa - BH & ") Then %>

 

<% If (ID <% =CmdGetGroups("Group_ID") = *3* Then %>

 

Thanks for your help,

 

Don Poss



__________________
Don Poss
Back to Top View DonP's Profile Search for other info by DonP Visit DonP's Homepage
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1769
Added: April/20/2007 at 4:29pm | IP Logged Quote cwilliams

I really dont know what to say. I mean I hear what your doing and see this code your showing and I am quite honestly shocked that you even came up with all of this...

I mean this is such a confusing deal that I dont even want other customers reading this as it will confuse them. LOL.. but really I am serious about that. I will be deleting this thread sooner or later.

I can give you these comments on some of that code...

<% If CmdListUsers("Groups") = "*3*" Then  %> INVALID SHOULD NOT USE = WHEN TESTING GROUP INFO - BECAUSE IT WILL ONLY WORK IF THE USER IS PART OF ONE GROUP ONLY

<% If InStr(Start, Groups, *3*) Then %>  INVALID - THE WORD START SHOULD BE A NUMBER OR NOT THERE AT ALL..

<% If InStr(Session("Groups"),"*3*") Then %> VALID

I mean perhaps some of the problem you are having is you are un-aware that functions involving textual comparison and other functions on data taken from MEMO fileds in a database often will fail if you do not put the data in a variable 1st.. its just something weird when working with ASP and Databases..

Meaning

<% If CmdListUsers("Groups") = "*3*" Then  %

wont give you correct results because Groups is a MEMO field

Because your working with a MEMO field you have to do this when testing the string for something.. basically stick it in a variable before you work with it...

<% Groups = CmdListUsers("Groups") %>
<% If InStr(Groups,"*3*") Then %>


BTW: it is also fine to test string info in a session variable..

You also should go into the database and actually look at the data contained in the GROUPS field for particular users... that should help you understand what your testing the field data for..

I also suggest anytime you are unsure of a value you are testing that you response write it's value on the page followed by a response.end... then you can make sure it really contains a value... debugging of sorts.. one step at a time..

As far as testing if a user is not part of a group I never put examples of that up because I never intended people to do that. I mean to me (my opinion only) its not good site design and odd logic. I mean if someone wants to do that I suppose it is possible but really... I don't think it is a smart way to design things... you should show things to users based on what groups thyey belong to... not (not show them things based on what groups they dont belong to) that to me is just a goofy way to do things... I mean it's doable I guess but it's not something I am going to support very long as far as figuring it out..


__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 

Sorry, you can NOT post info.
This info has been locked by a info administrator.

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area


Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.powerasp.com,www.aspclassifieds.com,www.aspphotogallery.com,www.codewanker.com