The Novell Controls for ActiveX and Visual Basic:
Creating Directory Entries

Lecture Hall
CampusblankAdminblankLibraryblankLabsblankLecturesblankTestingblankTransit Ctr
blank
PreviousNextHome Download SourceGlossary


Example Program: CreateEntry

CreateEntry allows you to create and delete organization, organizational unit, and user entries, based on descriptions contained in a text file. This is a valuable utility for creating and populating a directory to be used for testing NDS utilities. For example, when CreateEntry reads the following input file, it will create an organization entry named "VerySmallCompany," three organizational unit entries named "Marketing," "Engineering," and "Accounting," and 11 user entries in the containers that comprise the organization.

ORGANIZATION~VerySmallCompany
OU~VerySmallCompany\Marketing
OU~VerySmallCompany\Engineering
OU~VerySmallCompany\Accounting
USER~VerySmallCompany\George Smith~Smith~President~555-1212
USER~VerySmallCompany\Veronica Smith~Smith~Marketing VP~555-6318
USER~VerySmallCompany\Jedd Smith~Smith~Engineering VP~555-6051
USER~VerySmallCompany\Samuel Smith~Smith~Accounting VP~555-3694
USER~VerySmallCompany\Emma Jones~Jones~President's Secretary~555-3056
USER~VerySmallCompany\Marketing\Peter Smith~Smith~Inbound Mktg Dir~555-8562
USER~VerySmallCompany\Marketing\Jeanne Smith~Smith~OutBound Mktg Dir~555-3054
USER~VerySmallCompany\Marketing\Sharon Jones~Jones~Mktg Admin~555-2066
USER~VerySmallCompany\Engineering\David Smith~Smith~Eng Dev Dir~555-6521
USER~VerySmallCompany\Engineering\Tom Smith~Smith~Test Eng Dir~555-2054
USER~VerySmallCompany\Engineering\Tammy Jones~Jones~Eng Admin~555-1254

Figure 1: CreateEntry.


To build the CreateEntry program:

  1. Start Visual Basic and create a new "Standard EXE" project.
  2. Add the Novell Directory and Session controls to your project:
    • Open the Components dialog by selecting "Components" from the Project menu, or by right-clicking the Toolbox and selecting "Components" from the pop-up menu.
    • Scroll down the list of components and check the boxes next to "Novell Directory Control" and "Novell Session Control."
    • Click "OK."

CreateEntry consists of 3 forms and one code module. As mentioned earlier, two of the forms can be copied from the ReadField program.

ConnectionsForm, LoginForm, and Module1

The previous article in this series, "The Novell Controls for ActiveX and Visual Basic: Searching NDS Field Values" (October 1999), had instructions for designing and writing the associated code for two forms, ConnectionsForm and LoginForm, and one code module, Module1. You will need to make one small change to each of the two forms, so you should create a new directory for the SearchField program and copy ConnectionsForm.frm, LoginForm.frm, and Module1.bas to this new directory.

After copying the files, do the following:

  1. Add Module1 to the project by selecting "Add Module" from the Project menu, clicking on the "Existing" tab, and selecting the Module1.bas file that you just copied.
  2. Add the forms to the project by selecting "Add Form" from the Project menu, clicking on the "Existing" tab, and selecting the ConnectionsForm.frm and LoginForm.frm files that you just copied.
  3. For each form, double-click anywhere on the form to open the associated code and change the line of code that says
SearchFieldForm.Show

to

CreateEntryForm.Show
  1. Make ConnectionsForm the project's startup form by opening the project's property sheet from the Project menu, then selecting "ConnectionsForm" from the Startup Object drop-down menu.


PREVIOUSblankTop of PageblankNEXT

    Contact Us | Feedback | License | © 2000 Novell, Inc.
Novell > DeveloperNet > Developer Support
Novell Developer Kit > DeveloperNet University