Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2006, 11:21 AM
Registered User
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Writting to an ASCII File from VB6 no quotations

I Have a need to write records from a VB6 application to an ASCII text file (comma delimited) but not include quotation marks in the text. All my efforts thus far result in the records being written with the quotations in place. Any help will be appreciated.

 
Old April 19th, 2006, 11:01 AM
Authorized User
 
Join Date: Mar 2006
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Raghunathan
Default

hi

you can use the FileSystemObjects and TextStream Object to write the file. but
if u can post the code that you've tried so far. then it'd be of a great help to solve the problem.

as far as i've seen, we wont get any quotation marks while write ascii text files.

any how if i can c the code that u've tried, i would be able to help u solve the problem ASAP



Regards,
Raghu
 
Old April 21st, 2006, 03:32 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

First set a reference to the Microsoft Windows Scripting Runtime.
Code:
    Dim fso As FileSystemObject
    Dim ts as TextStream

    Set fso = New FileSytemObject
    Set ts = fso.OpenTextStream(<path & file>, ForWriting)

    With MyRecordSet
        Do Until .EOF
            ts.WriteLine !Fld1 & "," & _
                         !Fld2 & "," & _
                         !Fld3 & "," & _
                         !Fld4 & "," & _
                         !Fld5 & "," & _
                         !Fld6
            .MoveNext
        Loop
    End With
    This is of the top of my head, so a few of the names might be a little off, and the argument count too, but you should be able to get this from the Intellisense.





Similar Threads
Thread Thread Starter Forum Replies Last Post
SSIS - imoprt ASCII file yuvalk SQL Server 2005 5 January 18th, 2007 05:41 AM
windows service for writting a text file srkarthik_82 General .NET 0 January 4th, 2007 01:31 AM
Format of Inet Object in vb6..ASCII/BINARY? ksrmramu VB How-To 0 October 18th, 2005 02:45 AM
Display ASCII file using xsl... bmagadi XSLT 0 February 10th, 2005 07:52 AM
Write ASCII text file muklee C# 1 December 12th, 2004 09:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.