vreid Posted June 14, 2013 Share Posted June 14, 2013 Hi, I'm new to ASP and working from a dated book. The code in one example keeps giving me an error. Can anyone tell me what's wrong with the code? I'm using Dreamweaver to write the code, but running through the internet. The files are saved on the web server. I use crome because it tells me what's wrong. I'll post the code then post the error report. The code (and by the way, the txt file already exist.) <%option explicit %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...ransitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Guest Book</title></head><body><h1>Guest Book Response</h1><%=request.form("FirstName")%> <br /><%=request.form("LastName")%> <br />Gender:<%=request.form("Gender")%> <br />Age:<%=request.form("Age")%><br />Email:<%=request.form("email")%><br /><br /><%Dim filesys, peoplefileSet filesys = createobject("scripting.FileSystemObject")Set peoplefile=FileSys.OpenTextFile("Z:\vreid\gbpeople.txt",8,true)Peoplefile.writeline request.form("firstname")Peoplefile.writeline request.form("Lastname")Peoplefile.writeline request.form("Gender")Peoplefile.writeline request.form("age")Peoplefile.writeline request.form("email")Peoplefile.close%><h3> This information has been saved.</h3><a href="gblist.asp">See others who signed in.</a></body></html> The result: Guest Book Response Ginger, ReidGender:male, FemaleAge:32Email:greid@radford.edu Microsoft VBScript runtime error '800a004c'Path not found/gbproc.asp, line 19 Link to comment Share on other sites More sharing options...
justsomeguy Posted June 14, 2013 Share Posted June 14, 2013 The error messages indicates that the file it's trying to open doesn't exist. Make sure to use the correct path to the file on the server. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now