Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Array Question

Array Question

Scheduled Pinned Locked Moved Database
csharpdatabasecomsysadmindata-structures
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robby
    wrote on last edited by
    #1

    I have little experience with arrays and would like some help. I am querying an LDAP directory via a ActiveX component called AdvLDAP from Aspfusion.net. The code is below. What I want to do is be able to perform IF THEN statements on the variables in the array and insert some into a table. You can see from the LDAP.Attributes line what attributes I am returning. For instance, I want to return the attribute and value of "User-Suspend" so that I can perform something like "IF User-Suspend = "Y" THEN"...any help is appreciated. =========================================== dim LDAP set LDAP = Server.CreateObject("AdvLDAP.LDAP") LDAP.ServerName = "10.1.58.25" LDAp.Port = "389" LDAP.UserName = "tssacid=dsldap" LDAP.Password = "*******" LDAP.DN "c","us" LDAP.DN "o","upb" LDAP.DN "host","CAICCI" LDAP.DN "tssadmingrp","Acids" LDAP.DN "tssacid",""&userID&"" LDAP.Attributes = "Name;user-type;user-suspend" LDAP.Filter = "objectclass=*" LDAP.Scope = "Base" Set Result = LDAP.Query() if (LDAP.IsError = 1) then Response.Write LDAP.ErrorReason & "
    " else %> <% Dim cols,rows,Arr() cols = 0 rows = 0 for each Member in Result%> <%cols = cols+1 if (cols = 1) then set Links = Member.ValuesList() for each item in Links rows = rows + 1 next set Links = Nothing end if next %> <% ReDim Arr(cols, rows) c1 = 0 for each Member in Result r1 = 0 set Lnks = Member.ValuesList() for each Item in Lnks val = "" itm = Item.Value for i = 0 to ubound (itm) val = val & itm(i) if (i <> ubound (itm))then val = val & ", " end if next Arr(c1,r1) = val r1 = r1 + 1 next set Lnks = Nothing c1 = c1+1 next for rw = 0 to rows-1%> <%for cl = 0 to cols-1%> <%next%> <%next%>

    <%=Member.Attributes%>

    <% if (Arr(cl,rw) <> "")then Response.Write Arr(cl,rw) else Response.Write "-" end if%>

    <% End If %>

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups