Writing to a text file...continue... 
Author Message
 Writing to a text file...continue...

Dear all,

Below is the code that writes data to a text file in comma deliminated
format.

Open "c:\temp\textfile.txt" For Output As #1
'Write #1, shit; {*filter*}

rs_temp.MoveFirst

Do While Not rs_temp.EOF
   m_order = rs_temp!order
   m_ordernm = rs_temp!order_name
   m_cc = rs_temp!reference
   m_dt = rs_temp!date

   Write #1, m_cc, m_order, m_ordernm, m_dt

   rs_temp.MoveNext
Loop

To rephrase my question in my previous posting,

Q: How do I write data to a text file specifying m_order start at position
x, m_ordernm at positiony, and so on....(please, I do not need quotation
marks and comma)

Many thanks.



Sat, 06 Oct 2001 03:00:00 GMT  
 Writing to a text file...continue...
Hi LinK,
before writing to the textfile you can put all data to a string with fixed
positions ie.:

dim output as string

Do While Not rs_temp.EOF
    output = space(200)
    mid(output, 1, len(rs_temp!order)) = rs_temp!order
    mid(output, 20, len(rs_temp!order_name)) = rs_temp!order_name
    mid(output, 120, len(rs_temp!reference)) = rs_temp!reference
    mid(output, 150, len(rs_temp!date)) = rs_temp!date   ' or propably
format(rsTemp!date,"mm-dd-yyyy")
    Write #1,output
    rs_temp.MoveNext
Loop

So every field is at the same position (starting at 1,20,120,150) in the
textfile.
Hope this will help you.

CU Ronald
--
=> I'm in the computer business, I make Out-Of-Order signs. <=


Quote:
>Dear all,

>Below is the code that writes data to a text file in comma deliminated
>format.

> ...
>Many thanks.



Sat, 06 Oct 2001 03:00:00 GMT  
 Writing to a text file...continue...
Hi Ronal,

Thanks for your help. Yes, it works. But I still have a pair of double
quotation marks. This time, not for each column but for the whole
output(var) is in the quotation. How can I eliminite it? Please reply me.
Thanks.



Sun, 07 Oct 2001 03:00:00 GMT  
 Writing to a text file...continue...
Instead of

    Write #1,output

try

    Print #1, output

Rick

Quote:

>Hi Ronal,

>Thanks for your help. Yes, it works. But I still have a pair of double
>quotation marks. This time, not for each column but for the whole
>output(var) is in the quotation. How can I eliminite it? Please reply me.
>Thanks.



Sun, 07 Oct 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. writing to a text file ...continue

2. Reading from a text file and writing toa text file from Vis Bas 6.0

3. Write contents of listbox to text file/populate listbox from text file

4. Writing comma delimited text files using double quotes - Write Statement

5. Needed text box for text written from write to left

6. Open a text file, search for place holder, then write data to file

7. Question about writing a string to a text file (file.txt)

8. Need help editing an Input file (text) and writing the to a new, altered Output file

9. Setup cannot continue...Setup cannot continue...

10. continue a text form field from one page to another

11. continue a text form field from one page to another

12. Rich Text Box Continued

 

 
Powered by phpBB® Forum Software