Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can not create a Scripting.FileSystemObject with an ASP page

Status
Not open for further replies.

StevenWalsh

Technical User
Jul 11, 2000
6
GB
I have created a simple ASP page that takes values from various objects and is supposed to write the values to a text file. <br><br>However the error message I get is:-<br><br>Server object error 'ASP 0177 : 80070057' <br><br>Server.CreateObject Failed <br><br>/WroxCameras/save_contact.asp, line 132 <br><br>The operation completed successfully<br><br><br><br>I also include the code from the ASP page if that helps:-<br><br>Dim objFS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'File system object<br>Dim objSaveFile&nbsp;&nbsp;&nbsp;'File to save message to<br>'Dim variables to store form contents<br>Dim strEmailAddress,strSubject,strBody,strMailingList<br> <br>'read form and save in variables to save reading again later<br> <br> strEmailAddress = Request.Form(&quot;txtEmailAddress&quot;)<br> strSubject = Request.Form(&quot;txtSubject&quot;)<br> strBody = Request.Form(&quot;txtBody&quot;)<br> strMailingList = Request.Form(&quot;chkMailingList&quot;)<br> <br>'Create filesystemobject and open file<br>Set objFS = Server.CreateObject&quot;Scripting.FileSystemObject&quot;)<br>Set objSaveFile = objFS.OpenTextFile(&quot;C:\messages.txt&quot;,ForAppending,True)<br>
 
um, you forgot to put a ( in front of &quot;Scripting.FileSystemObject&quot;) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Thanks for the pointer ,&nbsp;&nbsp;however this is an error in my editing of my entry for this thread rather than the code in the asp page itself. The error itself still stands as is.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Regards<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Steve
 
the problem is the fact that you are using &quot;ForAppending&quot;&nbsp;&nbsp;I had this very same problem a couple days ago. ForAppending is undefined. declare your own constant with a value of 8.<br><br>Const FOR_APPENDING = 8
 
or you include the constant file, I forget what one it is, just like if you use ADO , you include ADODB.inc for the constants. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
<br>Excellent the page does not throw that error any more.<br>Bit naughty that the 'intellisense' feature comes up with the constant names rather than the numbers needed , but I guess I should read the manual more carefully next time.<br><br>Cheers for the tip
 
it would seem the intelisense know everything thats supposed to be there, by default it will throw all those constants into those include file, but you would have to include them yoursef, be nice if it said, you need this file to uses these constants. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
on the subject of intelisense, does this happen to you guys if you have a really long command like<br><br>document.frmMain.selOpt.options[document.frmMain.selOpt.selectedIndex].value<br><br><br>does interdev freeze up and eat up your memory after you type the period after selOpt
 
it'll freeze sometimes, then return, especially for objects that have no properties, but intelisense suspect it does it seems. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top