repeater data source?? Singapore
  • 14 years ago

    hello friends I am using actice directory as my data source through LDAP to get the usernam/password, and thn after authantication i use LDAP to get the user information (username, name, phone, email, location  etc from active directory user profiles)

    As u can see in the code i am using the loop to write the information on the page using

    Response. write

    I wan't to use some other data control to make the output more redable, like Repeater.

    Sub getdetails()

    Dim objCommand, objConnection, strBase, strFilter, strAttributes

    'Declare the variables as string

    Dim strQuery, objRecordset, strName, strCN, strCompany, strOfficeLocation, strDept, strJobtitle, strStreetAddress, strCounty, strPostalcode, strPhone, strMail

    objCommand = CreateObject(


    objConnection = CreateObject(


    objConnection.Provider =



    "Active Directory Provider")

    objCommand.ActiveConnection = objConnection

    'Define the Search Base, Filter and Attributes

    strBase =


    strFilter =

    "(&(objectCategory=person)(objectClass=user)(sAMAccountName=" + Me.lbl_welcome.Text + "))"

    'database field name are same as in AD

    strAttributes =


    'Subtree is the default base

    strQuery = strBase &

    ";" & strFilter & ";" & strAttributes & ";subtree"

    objCommand.CommandText = strQuery

    'objCommand.Properties("Page Size") = 100

    'objCommand.Properties("Timeout") = 30

    ' objectCommand_Properties(cache Results) if set to False gives some error so keep it True always


    "Cache Results") = True

    objRecordset = objCommand.Execute

    'Pick the values of the fields in string variables

    Do Until objRecordset.EOF

    'Search the whole database Record till EOF and put the field value in the string variable and write it to the document(page)

    strName = objRecordset.Fields(


    strCN = objRecordset.Fields(


    strCompany = objRecordset.Fields(


    strOfficeLocation = objRecordset.Fields(


    strDept = objRecordset.Fields(


    strJobtitle = objRecordset.Fields(


    strStreetAddress = objRecordset.Fields(


    strCounty = objRecordset.Fields(


    strPostalcode = objRecordset.Fields(


    strPhone = objRecordset.Fields(


    strMail = objRecordset.Fields(



    "User Name: " & strName & " Common Name: " & strCN & " Company Name: " & strCompany & " Office/Branch " & strOfficeLocation & " Department Name: " & strDept & " Job Title: " & strJobtitle & " Full Address: " & strStreetAddress & " County: " & strCounty & " Postal Code: " & strPostalcode & " Phone: " & strPhone & " Email: " & strMail)




    'Connection Closed

    End Sub


    I am using object recordset for this. can anybdy suggest me how i can use some other datacontrol with this coding.



  • 14 years ago

    CAN i use it with datagrid control

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens