COM 
 
Site navigation



Démo Télécharger Fonctionnalités Ecrans Support Témoignages

Previous Topic

Next Topic

Book Contents

Explanation of the ASP code

The header section is straightforward and contains the title of the page only. The ASP section contains the interesting part of the page and creates the user account and shows the results. The ASP section is described in detail below. The form section navigates the browser to the first page of the web site, CreateAccount.asp when the user clicks the Next user submit button.

Web site page line

Description

The user account created:

This is not part yet of the ASP section that starts with the <% characters. The text shown is simply copied to the HTML output and presented in the browser.

<%

Start of the ASP section. The lines that follow are ASP specified and terminated with the characters sequence %>.

Set Umra = Server.CreateObject("UMRAcom.Umra")

The UMRA COM object is now created. The CreateObject method is a member of the ASP built-in Server object. The Server object is available in all ASP pages and offers a number of useful methods (function call). The Server.CreateObject method is the standard method in ASP to initiate an instance of a registered COM object. The argument of the method is the name of the library that holds the COM object (UMRAcom) and the name of the object (Umra). The Set Umra = … construction creates an ASP script variable with name Umra and sets the value of the variable equal to the result of the Server.CreateObject method: the COM object. In the sequel of the ASP script, the COM object can now be used and must be referenced as the variable name: Umra.

RetVal=Umra.Connect("AMAZONE",56814)

The Connect method is part of the interface of the Umra COM object. It is used to setup a connection between the COM object itself and an UMRA Server. The method takes 2 arguments: the name of the computer and the port number used by the UMRA Service. The return value RetVal should be 0 on success and can be used for error handling purposes.

Umra.SetVariableText "%FirstName%",Request.Form("FirstName")

The method SetVariableText of the Umra COM object is used to initialize a variable-value pair. The COM object can hold a (single) list with multiple variable-value pairs. This list is sent to the UMRA Service when a project is executed. The SetVariableText method takes two arguments: the name of the variable (%FirstName%) and the value of the argument. In this case, the value is copied from the specified input field using the ASP Request object. The Form("FirstName") phrase refers to the input field with name FirstName of the original form of page CreateAccount.asp: <INPUT TYPE="TEXT" NAME="FirstName">. When this line of the script is executed, the list with variables stored in the Umra COM object holds the new variable-value pair.

Umra.SetVariableText "%LastName%",Request.Form("LastName")

Another variable-value pair is added to the list maintained by the UMRA COM object: The last name of the user account specified by the end-user in the form of web site page CreateAccount.asp is stored as variable %LastName% and copied from the input text field with name LastName.

RetVal=Umra.ExecuteProjectScript("CreateAccount")

The interface member ExecuteProjectScript of the COM object is now used to execute the project script on the UMRA Service. The only argument of the member function is the name of the project. The current variable list stored in the COM object is used as the input of the form project. Note that the project script is not executed by the UMRA COM object. Instead, the UMRA COM object instructs the connected UMRA Service to execute the project. The RetVal numerical variable returns as zero on success. The value can be used for error handling. When the project script is executed successfully, the variable list of the COM object is updated with the values that are generated by the UMRA project script.

RetVal=Umra.GetVariableText("%UserName%",UserName)

The GetVariableText interface member function is used to obtain the text value of the specified variable. The variable should be part of the variable list of the UMRA COM object. On success, the RetVal value should be zero and the ASP script variable UserName is filled with the actual value of the variable.

Response.Write "<BR>"

A break is written to the output HTML sequence that is generated by this ASP page.

Response.Write "User name: "

The text User name: is written to the HTML output.

Response.Write UserName

The value of the ASP variable UserName, as collected from UMRA variable %UserName%, written to the HTML output.

RetVal=Umra.GetVariableText("%Password%",Password)

The value of UMRA variable %Password% is searched for in the list maintained by the UMRA COM object. When found, the value is stored in ASP variable Password.

Response.Write "<BR>"

A break is written to the HTML output.

Response.Write "Password: "

The text Password: is written to the HTML output.

Response.Write Password

The value of the password is written to the HTML output.

%>

Termination of the ASP section. Normal HTML code follows after this character sequence or a new ASP section can start. In this example project, a small form is shown to navigate to the first page of the web site.

Table 3: Detailed description of the ASP page section using UMRA COM objects.

See Also

Setting up the IIS web site

Web site page: ShowResults.asp

Testing the web site

UMRA Service log file

Web site page: CreateAccount.asp


Home | Products | Support | Pricing | Download | Press | About Us | Contact | Sitemap
QUICK LINKS: Mass / Bulk Import Software | Network Monitoring Software | Disk Quota Management
QUICK LINKS: User and Active Directory Management | Active Directory Migration | SSRPM Documentation