All Elements
ELEMENT: <reference>
The
<reference>
tag can be used to include a reference to an external type library. This is useful for importing constants from the external type library. A reference can be created based on its ProgID or GUID. The
object
and
guid
attributes are mutually exclusive. The reference is valid within the job where it was created.
Syntax:
<reference [object="progID" | guid="typelibGUID"] [version="version_info"] />
Attribute: object
The
object
attribute can be used to create a reference based on its ProgID.
Attribute: guid
The
guid
attribute can be used to create a reference based on its type library GUID.
Attribute: version
The optional
version
attribute can be used to indicate which version of the type library to use. It must be in the form <major version>[.<minor version>]. If it is not specified, and cannot be derived from the Registry key for the specified ProgID or GUID, the default value "1.0" is used.
The following sample code creates a reference to ADODB.Recordset and displays the value of the constant named adUseClient. Note the use of the + rather than the & for the concatenation, since the & is a special character in XML
<?XML version="1.0" ?>
<!-- Filename: demo.wsf-->
<package>
<job>
<reference object="ADODB.Recordset"/>
<script language="VBScript">
WScript.Echo "adUseClient = " + CStr(adUseClient)
</script>
</job>
</package>
Output:
adUseClient = 3
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information