Results 1 to 3 of 3

Thread: VB Scripting error in guestbook Please help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Posts
    117
    I have made this guestbook using as an ASP file using VBScript. Basically what it does is get form values, append it into a text file and filnnaly display the textfile. However it is giving me an error. HERE is my code

    Code:
    <%@ Language=VBScript %>
    <%Dim strfile
      strFile = Server.MapPath("guestbook.txt")
      
      if Request.Form.Count = 0 then
    %>
      
    <H3>Sign Our Guestbook:</H3>
    	<FORM ACTION="guestbook.asp" METHOD="post">
    	<TABLE>
    		<TR>
    		<TD ALIGN="right"><B>Name:</B></TD>
    		<TD><INPUT TYPE="text" NAME="name" SIZE="15"></INPUT></TD>
    		</TR>
    		<TR>
    		<TD ALIGN="right"><B>Comment:</B></TD>
    		<TD><INPUT TYPE="text" NAME="comment" SIZE="35"></INPUT></TD>
    		</TR>
    	</TABLE>
    	<INPUT TYPE="submit" VALUE="Sign Guestbook!"></INPUT>
    	</FORM>
    
    	<BR>
    
    	<H3>Today's Comments:</H3>
    	
    	<!--#INCLUDE FILE="guestbook.txt"-->
    
    <% Else
       Dim fso 
       Dim objFile
       
       Set fso     = Server.CreateObject_("Scripting.FileSystemObject")
       
      Set objFile = fso.OpenTextFile_(strFile,ForAppending,8,TristateTrue)
       
       objFile.Write Request.Form("name")
       objFile.Close
       Set objFile = Nothing
       Set fso = Nothing
       End if
       %>
    And this is the error message

    Code:
    Server object error 'ASP 0177 : 80070057' 
    
    Server.CreateObject Failed
    Someone please please help, i have to finish this project in a week.



  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    make sure you have write permissions to the folder your writing to..

    by the way,, i wouldnt' use .txt files to store guestbooks
    its better to use a db, like access..

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Posts
    117
    What do you mean by write permissions and how do i do it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width