Array Question
-
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 %>