PDA

Click to See Complete Forum and Search --> : VB Scripting error in guestbook Please help


royjacob
Nov 4th, 2000, 09:58 PM
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


<%@ 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


Server object error 'ASP 0177 : 80070057'

Server.CreateObject Failed


Someone please please help, i have to finish this project in a week.

kovan
Nov 6th, 2000, 08:40 AM
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..

royjacob
Nov 8th, 2000, 09:55 PM
What do you mean by write permissions and how do i do it?