What is "My quotes"?
Export data to text file in VB6
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > Visual Basic Programming > Export data to text file in VB6 1 March 2010 14:49:40

  Top users: 
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

Export data to text file in VB6

Guest 20 October 2005 13:13:39
 Dear all ,

Does anyone have source code about exporting data to text file in
visual basic 6 ? Also , user can select save location and edit file
name.

Thanks in advance.

Stanley

Add comment
Phill. W 20 October 2005 14:45:09 permanent link ]
 <stanleysin@gmail.co­m> wrote in message
news:1129803219.192­563.164650@g47g2000c­wa.googlegroups.com.­..
Does anyone have source code about exporting data to text file> in visual basic 6 ?

There's no "one-liner" built in, but read up on Open, Print # and Close.
Also , user can select save location and edit file name.

That'll be the CommonDialog Control's ShowSave method ...

Putting these together, you get something like ...

With CommonDialog1
On Error Resume Next
.CancelError = True

.ShowSave

If Err.Number = 0 Then
Dim iFile as Integer : iFile = FreeFile

Open .Filename For Output as #iFile
Print #iFile, <data>
Close #iFile
End If
End With

HTH,
Phill W.


Add comment
Guest 11 May 2007 02:26:42 permanent link ]
 Dim sData$, file%
file = FreeFile()
Open "C:\DBASE.TXT" For Output As #file
rs.MoveFirst
While Not rs.EOF
' You can set bigger NumRows to make it faster
' Or if the data is small, u can use -1 to get all data at once
sData = rs.GetString(NumRow­s:=1, ColumnDelimeter:=",­")
' remove the vbCr at the end of string
If Len(sData) Then sData = Left(sData, Len(sData) - 1)
Print #file, sData
' do not call MoveNext
'the GetData automatically updates the record position
Wend
Close #file
Add comment
Guest 22 June 2009 06:46:14 permanent link ]
 :-P­
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > Visual Basic Programming > Export data to text file in VB6 1 March 2010 14:49:40

see also:
AC Fan use in PC??
59C Temps Running Very Few Programs…
Re: Re: Biostar M7NCG 400 MoBo…
pass tests:
†...Avatars from Moka...†
see also:
Hi!
hello

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .