write to csv

A

asdf

Hello

I am using frontpage 2002.
I have a form and I want the form info to go to a csv file. I know that I
can use the wizard or editor and save to csv, but I have my form post the
info to another page that says "you've completed ..." and the submitters info
is under that and a "print this certificate to keep for your records" button
is under that.
What I want to do is when the "you've complete" page comes up...I want the
user's info to go to a csv file.
I tried this code I found for test:
<%
dim fs, f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt",true)
f.WriteLine("Hello World!")
f.Close
set f=nothing
set fs=nothing
%>
The file doesn't get created. I was thinking if this code worked, I will
just change the file from .txt to .csv and insert a string that has all the
data separated by commas. I guess it's not that easy.

Can anyone help me?
Thank you.
 
A

asdf

Ok...I got the wizard thing to work so I don't need the code to write the
form data to a .csv file.
It would still be nice to know though. Should this code work for write to
csv file? Or is it totally wrong for csv?
<%
dim fs, f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt",true) 'just change the .txt to .csv?
f.WriteLine("Hello World!") 'change this to something like ("bob, alaska")
f.Close
set f=nothing
set fs=nothing
%>
Thanks for your time!
 
R

Ronx

You need the correct permissions for (I think) the Internet Guest
Account (IUSR_machinename) on the folder for creating and modifying
files before it will work. It is unlikely that that the C:\ folder will
have those permissions.
Other than that, the code is correct.
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.

http://www.rxs-enterprises.org/fp
 
T

Thomas A. Rowe

You must have permission to use the FileSystemObject and it has to have create/modify/write
permissions, etc. set by the web host.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top