Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matching to an array

Status
Not open for further replies.

struth

Programmer
Aug 26, 2001
114
GB
I have different administrative sections which can be allocated to more than one member. These member/admin rights are held in a table (sectionAdmin):

sectionID | memberID
----------+----------
1 | 23
----------+----------
2 | 23
----------+----------
1 | 14
----------+----------

I want to check if these match as members navigate through the sections and then, if they do, open up the admin rights.

eg
if rsSectionAdmin("sectionID")=thisSectionID then
adminRights=true
end if

I have tried setting up an array using GetRows and although I think I am on the right track I can't get it to work.

I'd be grateful if you could help me out here.

TIA

"Away from the actual ... everything is virtual"
 
adminRights = false
set rs = cn.execute("select count(*) from myTable where memberID = " & session("memberID") & " and sectionID = 2")
if rs(0) > 0 then adminRights = true

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
i need some more ingo:

if rsSectionAdmin("sectionID")=thisSectionID then
adminRights=true
end if

on what basis is this check stmt? who is the admin user?

Known is handfull, Unknown is worldfull
 
Count ....of course! Duh!

Thanks



"Away from the actual ... everything is virtual"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top