p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Argh ! Textfile


Message #1 by <johncogan@e...> on Wed, 2 Aug 2000 16:37:41 +0100
Hi

Yea There are permissions for that file. Will try it with a single write
after concatenating.

Still getting to that section of the book regarding databases.

Thx for your reply


----- Original Message -----
From: "Robert Chartier" <Robert.Chartier@T...>
To: "Code Clinic" <proasp_codeclinic@p...>
Sent: Tuesday, September 19, 2000 5:28 PM
Subject: [proasp_codeclinic] RE: Argh ! Textfile


does the IUSER_MACHINENAME have sufficient priveldeges to write to that
disk?

also, consider concantenating your variables and then writing once

sAll = firstname & vbCrLf & lastName & vbCrLf & emailaddress  & vbCrLf &
icqnumber & vbCrLf &  callsign  & vbCrLf & myage
objFile.Write sAll



also, you consider using a database?



-> -----Original Message-----
-> From: johncogan@e... [mailto:johncogan@e...]
-> Sent: Tuesday, September 19, 2000 5:12 PM
-> To: Code Clinic
-> Subject: [proasp_codeclinic] Argh ! Textfile
->
->
-> Hi
->
-> The dollowing code is not writeing to my text file even
-> though I ahve the
-> path correct. I did a test write (objFile.Write "TEST") in
-> one section and
-> it wrote out the stringf i supplied it but when trying to
-> write out the
-> contents of variables it fails. The variables are filled
-> with information
-> coming from another page form that has 6 elements. I have
-> double checked the
-> element names are correct but for the life of me cannot get
-> this to work on
-> the variables.
->
-> TIA
-> John Cogan
->
-> <%
-> Option Explicit
->
-> Dim firstName, lastName, emailaddress, icqnumber, callsign, myage
-> Dim objFile, FilePath, objFSO, temp
->
-> firstName = Request.Form("RealFirstName")
-> lastName = Request.Form("RealLastName")
-> emailaddress = Request.Form("Email")
-> icqnumber = Request.Form("Icq")
-> callsign = Request.Form("Callsign")
-> myage = Request.Form("Age")
->
-> FilePath = Server.MapPath("/db/paintpeople.txt")
-> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
-> Set objFile = objFSO.OpenTextFile(FilePath,8,FALSE)
->
-> 'objFile.Write "TEST"
-> objFile.Write callsign
->
->
-> Set objFSO = nothing
-> objFile.Close
-> Set objFile = nothing
-> FilePath = ""
->
-> '--------------------------------------------- Second data
-> store ---------------
->
-> FilePath = Server.MapPath("/db/paintdetails.txt")
-> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
-> Set objFile = objFSO.OpenTextFile(FilePath,8,FALSE)
->
-> objFile.Write firstname
-> objFile.Write lastName
-> objFile.Write emailaddress
-> objFile.Write icqnumber
-> objFile.Write callsign
-> objFile.Write myage
->
-> Set objFSO = nothing
-> objFile.Close
-> Set objFile = nothing
-> FilePath = ""
->
-> Response.Redirect "default.asp"
-> %>
->

  Return to Index