Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 12th, 2006, 05:09 AM
dawnong dawnong is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 45 dawnong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 31 m 55 sec
Reputation Power: 4
Unhappy Export Data from VB6.0 to a text file

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

Reply With Quote
  #2  
Old January 12th, 2006, 05:16 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
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



Reply With Quote
  #3  
Old January 12th, 2006, 05:21 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
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

Reply With Quote
  #4  
Old January 13th, 2006, 02:30 AM
dawnong dawnong is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 45 dawnong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 31 m 55 sec
Reputation Power: 4
Unhappy

Hi,

I'm using SQL Database. Do I need to add the reference under the library?
set FSO = Server.CreateObject("Scripting.FileSystemObject")

Reply With Quote
  #5  
Old January 13th, 2006, 02:37 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
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

Reply With Quote
  #6  
Old January 13th, 2006, 02:47 AM
dawnong dawnong is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 45 dawnong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 31 m 55 sec
Reputation Power: 4
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

Reply With Quote
  #7  
Old January 13th, 2006, 03:05 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
yes, sorry, you need this reference

"Microsoft Scripting Runtime"


Reply With Quote
  #8  
Old January 13th, 2006, 03:18 AM
dawnong dawnong is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 45 dawnong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 31 m 55 sec
Reputation Power: 4
It's OKay. Thanks. I will try it out.

Reply With Quote
  #9  
Old January 13th, 2006, 03:40 AM
dawnong dawnong is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 45 dawnong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 31 m 55 sec
Reputation Power: 4
Thumbs up

Thanks. It works.

Reply With Quote
  #10  
Old January 13th, 2006, 03:45 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107805 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
no problem, glad its working

Reply With Quote
  #11  
Old January 16th, 2006, 09:17 AM
Pete Kirkham Pete Kirkham is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 1 Pete Kirkham User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 8 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Export Data from VB6.0 to a text file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |