Hi,
I'm facing a problem in exporting data through VB6.0 to a text file. How can I do that? I need to get the data and use commas as separators and display in text file.
Thanks,
Dawn

what is the source of the data?
does it come from a database?
You can easilly use the FSO to create such a file.
could you post a bit more detail, and code you have.
Was this answer helpful ?
Yes No
here is a short example
using a recordset for data from a db
Code:
Dim FSO, theFile
set FSO = Server.CreateObject("Scripting.FileSystemObject")
set theFile = FSO.CreateTextFile("filename.txt")
while NOT rs.EOF
theFile.Write(rs("Field1") & ",")
theFile.Write(rs("Field2") & ",")
theFile.Write(rs("Field3"))
theFile.WriteLine()
rs.MoveNext
wend
hope this helps
Was this answer helpful ?
Yes No
Hi,
I'm using SQL Database. Do I need to add the reference under the library?
set FSO = Server.CreateObject("Scripting.FileSystemObject")
Was this answer helpful ?
Yes No
Hi,
sorry about that, I gave you an ASP example,
use this syntax instead
Code:
Dim fso As New FileSystemObject
set theFile = FSO.CreateTextFile("filename.txt")
hope this helps
Was this answer helpful ?
Yes No
It's Okay. Sorry to trouble you again. I can't get the FileSystemObject. Do I have to add reference?
dim fso as new FileSystemObject
Was this answer helpful ?
Yes No
yes, sorry, you need this reference
"Microsoft Scripting Runtime"

Was this answer helpful ?
Yes No
It's OKay. Thanks. I will try it out.
Was this answer helpful ?
Yes No
Was this answer helpful ?
Yes No
no problem, glad its working

Was this answer helpful ?
Yes No