Article ID: 163009
Article Last Modified on 5/2/2006
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":
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.
<!--#include virtual="/ASPSAMP/SAMPLES/FILEVBS.INC"-->(Save the text below to file: Filevbs.inc)
<% '---------------------------------------------- ' ' FileSystemObject constants include file for VBScript ' '-----------------------------------------------------> '---- iomode Values ---- Const ForAppending = 8 Const ForReading = 1 Const ForWriting = 2 '---- format Values ---- Const TristateFalse = 0 Const TristateMixed = -2 Const TristateTrue = -1 Const TristateUseDefault = -2 %>
261250 HOWTO: Expose and Use ENUMS from Visual Basic Components in Active Server Pages
Keywords: kbdocfix kberrmsg KB163009