Configuring the Visual Basic Environment

   

Configuring the Visual Basic Environment

With Visual Basic and ADSI installed, you can create a Visual Basic project template that speeds testing and modification of the code segments found in the following chapters. You can start a new project and configure the environment each time manually using the steps outlined in Exercise 2.1, or you can save it as a template to be used when creating a new project that utilizes ADSI.

Exercise 2.1 Creating a Visual Basic Project Template
  1. Begin by launching Visual Basic.

    Note

    For purposes of this exercise, all example images were shot using Visual Basic 6.0 Enterprise on a Windows NT 4.0 Workstation. However, the same steps should apply for either VB 5.0 or VB 6.0.


  2. A dialog box prompts you to create a new project. Create a new project based on the Standard EXE template (see Figure 2.1).

    Figure 2.1. Creating a New Project in Visual Basic.

    graphics/02fig01.gif

    Note

    If you disabled this dialog box from presenting on start up, or recently closed another project, simply click File, New Project, and select the Standard EXE icon.


  3. Add a command button to Form1 that will be used to launch the code for testing in your environment (see Figure 2.2). The layout and configuration of the form is unimportant; a simple command button added to the form is adequate.

    Figure 2.2. Create a Test Form.

    graphics/02fig02.gif

  4. Name the command button cmdTest , because the examples that follow will depend on this exact nomenclature within the form.

  5. After you arrange the objects on the form, set a reference to the Active DS Type Library (see Figure 2.3). To do this, click Project from the menu bar, then select References . If you do not see the "Active DS Type Library" entry in the list of references, make sure the ADSI 2.5 libraries are properly installed on your workstation.

    Figure 2.3. Set a Reference to the Active DS Type Library.

    graphics/02fig03.gif

  6. Save the form and project for future use. If you plan to do a significant amount of work with ADSI, you can save the project to the Template\Projects directory, which creates an entry in the New Project dialog box. Taking such an action will allow you to create a new project with the reference set and form created immediately upon launching Visual Basic.


   
Top


Windows NT. 2000 ADSI Scripting for System Administration
Windows NT/2000 ADSI Scripting for System Administration
ISBN: 1578702194
EAN: 2147483647
Year: 2000
Pages: 194
Authors: Thomas Eck

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net