|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ![]() |
|
#2
|
||||
|
||||
|
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.
__________________
Look! Its a ShemZilla ![]() ![]()
|
|
#3
|
||||
|
||||
|
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 |
|
#4
|
|||
|
|||
|
Hi,
I'm using SQL Database. Do I need to add the reference under the library? set FSO = Server.CreateObject("Scripting.FileSystemObject") |
|
#5
|
||||
|
||||
|
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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
||||
|
||||
|
yes, sorry, you need this reference
"Microsoft Scripting Runtime" ![]() |
|
#8
|
|||
|
|||
|
It's OKay. Thanks. I will try it out.
|
|
#9
|
|||
|
|||
|
Thanks. It works.
![]() |
|
#10
|
||||
|
||||
|
no problem, glad its working
![]() |
|
#11
|
|||
|
|||
|
I'm trying to use FileSystemObject from a command line compile and I can't find the right namespace (especially since there seems to be no convention). I have:
IMPORTS System IMPORTS Microsoft.VisualBasic What's missing because FSO, DRIVE and DRives are undefined. Same thing works fine in the VB Macro section of Outlook! It appears that the .dll should be in the Framewor directory. Not use if you have to go through GAC to register it too but once I know which dll contains the bits I want, I'll be fine. Pete |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Export Data from VB6.0 to a text file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|