Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fso: create text file,then copy file

Status
Not open for further replies.

georgeous

Programmer
Jul 11, 2001
38
GB
I have this problem with file system objects, and its driving me barmy
basically what i want to do is to create a text file on the server and then copy that file to a users directory.

I have set up the createText file and it works fine ( it takes records from a database and writes it to a web page), but i can't seem to copy the file. I get errors saying path not found (even though i've written it properly) and loads of othe weird errors

(a) do i have to set up two different objects, or can i run them both together

here is my code:

file_being_created= rs("id") & ".htm"
set fso = createobject("scripting.filesystemobject")
Set act = fso.CreateTextFile (server.mappathfile_being_created), true)


and then it creates the file.

At this point i want to copy the file
is this right ->
fso.CopyFile "path of file", "c:\m files"
set fso = nothing

or

do i have to set up a 2nd fso?

hope this makes sense
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top