DOC: Values for Scripting Object Constants Defined (163009)
The information in this article applies to:
- Microsoft Active Server Pages
- Microsoft Internet Information Server 4.0
- Microsoft Internet Information Server 5.0
This article was previously published under Q163009 We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site: SUMMARY
The version of VBScript (VBS) provided with Active Server Pages currently
does not have access to the values of constants defined by the Scripting
object. As a result, you must provide a definition of the constants you
wish to use in your scripts. Because the documentation does not provide the
values for these constants, it can be difficult to determine what the
numerical value is for a given constant.
Consider the following code example:
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile("c:\testfile.txt", ForAppending, FALSE)
If you cut and paste this code into an .asp file, you get the following
error because VBS doesn't recognize "ForAppending":
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'fs.OpenTextFile'
The best approach is to use a server-side include file to provide a
definition of the constants for your script. This is similar to using the
Adovbs.inc or Adojavas.inc files provided with ADO.
REFERENCES
An alternative approach is described in the following Microsoft Knowledge Base article:
261250 HOWTO: Expose and Use ENUMS from Visual Basic Components in Active Server Pages
For the latest Knowledge Base articles and other support information on
Visual InterDev and Active Server Pages, see the following page on the
Microsoft Technical Support site:
Modification Type: | Major | Last Reviewed: | 5/2/2006 |
---|
Keywords: | kbdocfix kberrmsg KB163009 |
---|
|