XML and Internet Support

SQLVDirs Collection Object

The SQLVDirs collection object is returned by the SQLVDirControl.SQLVDirs method. With the SQLVDirs collection object, you can access a specific virtual directory (using the Item method), create a new virtual directory (using the AddVirtualDirectory method), or remove an existing virtual directory (using the RemoveVirtualDirectory method).

The SQLVDirs collection object supports these standard methods:

Next method

Retrieves the next virtual directory (or directories). An integer specified for Next determines the number of virtual directories to retrieve.

Skip method

Skips the virtual directory (or directories). A number specified for Skip determines how many virtual directories to skip.

Reset method

Resets the collection index to the first virtual directory.

Clone method

Returns a copy of the SQLVDirs collection object.

Count method

Returns the number of virtual directories.

Item method

Retrieves one virtual directory. You can specify an integer (starting with 0 for the first virtual directory) or the name of the virtual directory.

The SQLVDirs collection object also supports these methods:

AddVirtualDirectory method

Takes the name of the virtual directory to create. This method creates a new virtual directory in the metabase with all the defaults. However, some properties, like the default database are not set.

The AddVirtualDirectory method or Item method returns a SQLVDir object that represents the virtual directory.

RemoveVirtualDirectory method

Removes the virtual directory from the Microsoft® Internet Information Sevices (IIS) metabase.

Examples

This example establishes a connection to the first Web site on an IIS server. The first virtual directory object (index value 0) on the connected Web site is accessed.

Set ObjXML = CreateObject("SQLVDir.SQLVDirControl")
ObjXML.Connect "IISServer", "1"
Set ObjVDirs = ObjXML.SQLVDirs
Set ObjVDir = ObjVDirs.Item(0)
' or ObjVDirs(0) since Item() is the default
...
ObjXML.Disconnect