473,486 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to write a continuous line in a text file?

Hello,

I need to write a continuous line (without CR-LF) in VBA into a text file.
I tried opening the file as binary and used the "put" command but it inserts
the data type and length before the actual data. Is there a way to do this
in Access? Thanks in advance.

Jay
Jan 24 '07 #1
2 4584
build the string in your loop and then use "Write" when you're all done
to output it.

dim strA as string
open filename for output as #1
strA = ""
do while not done
strA = strA & thenextpiece
loop
write #1, strA
close #1

On Jan 24, 9:58 am, "Jay S." <j...@noemail.comwrote:
Hello,

I need to write a continuous line (without CR-LF) in VBA into a text file.
I tried opening the file as binary and used the "put" command but it inserts
the data type and length before the actual data. Is there a way to do this
in Access? Thanks in advance.

Jay
Jan 24 '07 #2
Thanks for your reply. I figured it out. I created a fixed 80 char string
and used "put" for every record. It didn't include the 2-byte var info
since it was a fixed length string. I didn't use "write" the way you did
because the line can go on for a while and there's a limit to a variable
string length (IIRC). Thanks again though.

Jay

"Jason Lepack" <jl*****@gmail.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
build the string in your loop and then use "Write" when you're all done
to output it.

dim strA as string
open filename for output as #1
strA = ""
do while not done
strA = strA & thenextpiece
loop
write #1, strA
close #1

On Jan 24, 9:58 am, "Jay S." <j...@noemail.comwrote:
Hello,

I need to write a continuous line (without CR-LF) in VBA into a text
file.
I tried opening the file as binary and used the "put" command but it
inserts
the data type and length before the actual data. Is there a way to do
this
in Access? Thanks in advance.

Jay

Jan 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1497
by: Marty | last post by:
Hi everybody, Is it possible to do that in VB.NET: I have a text file that is filled with new lines of text every n seconds. This text file get very massive. I want to have my program to...
3
2646
by: John Flynn | last post by:
hi, having problems reading from and writing back to the same file. basically, i want to read lines of text from a file and reverse them and write them back to the same file.. it has to...
5
2180
by: Armando | last post by:
I recently saw the tail end of a "Continuous forms" discussion, but not enough was available to see if this will be a PITA repeat question. Sorry if it is. On a form with its Default View...
1
4288
by: Magix | last post by:
Hi, I have these string data: str_data1, str_data2, str_data3, which capture some value after a routine process A. Then I would like to write (append) these 3 string values into a text file each...
11
3535
by: Doug Bell | last post by:
Hi, I am trying to create form that displays data like an Access continuous dataform rather than using a data grid. I am thinking that I can achieve this by creating a row of text boxes, one...
12
11048
by: Nina | last post by:
Hi there, What is the maximum length that one line can hold in a text file using StreamWriter's Write or WriteLine method? If the string is too long for one line to hold, what will Write or...
8
7486
by: JohnDoe528 | last post by:
Using Access 2000 on XP, I have a continuous subform that lists the different licenses attributed to a person selected (current record of the main form). This is what each line of the sub form looks...
6
18286
by: globalrev | last post by:
i ahve a program that takes certain textsnippets out of one file and inserts them into another. problem is it jsut overwrites the first riow every time. i want to insert every new piece of...
3
1974
by: AdamOnAccess | last post by:
This is something I've always had trouble with, and it comes up fairly frequently... I have a continous form with a single text field and next to this text field, I have a caption that maintains...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4865
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.