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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use Textstream object?

Status
Not open for further replies.

therick

Programmer
Mar 20, 2001
34
US
I need to pass a string from an asp form to a variable and write it to a new file. I cannot get intellisense to pull up the .write method. Please tell me what I'm doing wrong here as I know this is easy and have done in VB hundred times. Also, how do I add a wildcard/unique identifier w/ date and time to file name? Thanks,

Dim oFSO, oTS
Dim strXML


'Establish Connection & RecordSet objects
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
'set oTS = server.CreateObject("Scripting.Textstream")


strXML = Request.Form("Post_Accept")

'set oTS = oFSO.CreateTextFile
set oTS = oFSO.CreateTextFile("C:\lanlordreports\trojan_sweep_" &date &".xml")
ots.write strXML
 
you were close...
set oTS = oFSO.CreateTextFile("C:\lanlordreports\trojan_sweep_" & date() &".xml")

the date function in VBScript needs a set of brackets after it for some unknown reason.

G -GTM Solutions, Home of USITE-
-=
 
Thanks a bunch. Working great! I appreciate the quick responses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top