It's the ForWriting argument I suspect.  Those constants only work if
you include that mammoth include file that defines them.  I prefer to
use the actual values instead of the constants because then it will
always work.

Try this...

objFSO.OpenTextFile(fileLocation, 2, False)

- Vieth

> -----Original Message-----
> From: Andy and Kim Mills [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, May 26, 2004 7:44 AM
> To: [EMAIL PROTECTED]
> Subject: [ASP] Invalid procedure call or argument
> 
> Hello Guys:
> 
> I can't seem to figure out what is wrong with this statement.  
> 
> fileLocation = Server.MapPath("MessageBoard.txt")
> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
> If (objFSO.FileExists(fileLocation)) Then
>    *Set objFile = objFSO.OpenTextFile(fileLocation, ForWriting, False)
>    objFile.Close
>    Set objFile = Nothing
> End If
> Set objFSO = Nothing
> 
> I get an Invalid Procedure Call or Argument on the line I 
> marked with an *.  This is what Microsoft says the line 
> should look like, so I am confused as to what is happening.  
> 
> I tried to hardcode the value of the fileLocation as well:  
> but that didnt work either.
> 
> Any thoughts would be appreciated.
> 
> Thanks
> Andy
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> --------------------~--> Yahoo! Domains - Claim yours for 
> only $14.70 http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/17folB/TM
> --------------------------------------------------------------
> ------~-> 
> 
> --------------------------------------------------------------
> -------    
>  Home       : http://groups.yahoo.com/group/active-server-pages
> ---------------------------------------------------------------------
>  Post       : [EMAIL PROTECTED]
>  Subscribe  : [EMAIL PROTECTED]
>  Unsubscribe: [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to