InitEx Method

The InitEx method initializes the object with a Internet Information Server instance identifier and a boolean flag specifying whether a login credentials prompt should be presented to the user.

IDL Definition

HRESULT InitEx(
[in] BSTR bszHostName,
[in] VARIANT_BOOL fPromptCredentials
);

Parameters

bszHostName

The Internet Information Server instance identifier

fPromptCredentials

A flag specifying whether to prompt the user for credentials.

Return Values

a standard HRESULT value

Remarks

This method is identical to the Init method except that it allows the Credentials flag to be set.  This flag is meaningful in the following situations:

 In this case, an interactive user (not a web user) will be prompted with a standard dialog box whenever they attempt to load a specific ADSI schema object defined by one of the AUO provider definitions.   The dialog asks whether they want to log on anonymously or specify a username and password.  The name they specify should be a username in the corresponding Membership Directory Service.

Avoid using the InitEx method within ASP pages.   Simply create the object using the Server.CreateObject method.  This will automatically call the Init method for you.

Example

Visual Basic 5.0 (stand alone EXE)

Dim SchemaObj as SchemaObjects
Set SchemaObj = new SchemaObjects

SchemaObj.InitEx “3”, TRUE

Dim IADs as IADs
Dim List as Variant  ‘ an array

Set IADs = SchemaObj

List = IADs.Get(“mustContain”)   ‘ this causes the schema defined for the 
                                 ‘  default AUO provider to be loaded
                                 ‘  However…
‘  AT THIS POINT, the interactive user running the VB app would
‘  be presented with a login dialog.  In order to proceed, they would
‘  have to authenticate against the membership directory service 
‘  database.

‘… go on to use the schema object

© 1997-1998 Microsoft Corporation. All rights reserved.