Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 1st, 2004, 08:43 AM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Recordset size is always 100

Hello all,

I am trying to retrieve all users of our domain using ADSI.
Although there are more then 1150 users in our Active Directory,
the output is always 1000 records.
Can anyone help me?
Here is the code :
Thanks in advance.

<%@ Language = VBScript %>
<html>
<head>
<title> ADSI Results Page </title>
</head>
<body background="exptextb.jpg" bgcolor="#FFFFFF" text="#000000">
<h1><center> Results </center></h1>
<%
Dim strSearchBase
strSearchBase = "LDAP://dc=novabank,dc=gr"

'Set a filter for searching
dim strfilter
strfilter = "(&(displayname=" & displayname &"*)" & "(givenname="& givenname &"*)" & "(Title=" &"*))"
'strfilter = "(&(displayname=" & displayname &"*)" & "(givenname="& givenname &"*))"
'Select the Attributes you want to see
Dim strAttribs
strAttribs = "displayName,mail"


'Set the searching scope, We are searching the AD tree from the beggining to the end.
Dim strScope
strScope = "subtree"


'connection to Active Directory and crestion of the first Recordset --Dim strCommandText
strCommandText = "<" & strSearchBase & ">;" _
    & strFilter & ";" & strAttribs & ";" & strScope

Dim oConnection
Set oConnection = Server.CreateObject("ADODB.Connection")
Dim oCommand
Set oCommand = Server.CreateObject("ADODB.Command")

oConnection.Provider = "ADsDSOObject"

oConnection.Open "Active Directory Provider"



set oCommand.ActiveConnection = oConnection
oCommand.CommandText = strCommandText


Dim oRecordset
set orecordset = Server.CreateObject("ADODB.Recordset")
oRecordset.maxrecords=1100
Set oRecordset = oCommand.Execute(strCommandText) 'First recordset creation

%>
<center>
<TABLE Border=4 cellspacing=1>
<TR>
    <TH>Full Name</th><th>mail</th></tr>
</center>
<%
Response.Write "</tr>"
While Not orecordset.EOF
    Response.Write "<tr>"
    For Each oField in orecordset.Fields
        Response.Write "<td>"

        Response.Write ofield.value & "&nbsp;"

            Response.Write "</td>"
    next
    Response.Write "</tr>"
    orecordset.MoveNext
Wend
i=orecordset.recordcount

Response.Write "</tr></table>"

response.write( "number of records : " & i)

'******** Clear the Recordsets

  oRecordset.Close

   Set orecordset = Nothing
   Set oconn = Nothing


%>
<BR>


</body>
</html>



 
Old June 1st, 2004, 08:57 AM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Error in subject!!!
The recordset size is always 1000

Sorry.....

 
Old June 14th, 2004, 12:11 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

You can do this by looping and You may use 2 loops to get record set

Love 4 all





Similar Threads
Thread Thread Starter Forum Replies Last Post
100% but still too wide? stay_asleep Dreamweaver (all versions) 1 December 16th, 2005 09:40 AM
error 500.100 hastikeyvan Dreamweaver (all versions) 0 November 20th, 2005 02:25 AM
100% CPU Usage anioak VS.NET 2002/2003 0 November 16th, 2004 08:47 AM
Determining size of recordset column gp_mk ADO.NET 0 May 27th, 2004 04:12 AM
100% MySQL newbie Adam H-W MySQL 0 November 7th, 2003 12:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.