View Full Version : Displaying A Long String


gemma-the-husky
06-08-2008, 07:37 AM
I have tried to read in a text file, and display it in a text box

according to Access help (2002XP as it happens) a variable length string can be 2billion chars

I am holding the string in a global variable, type string
I then assign it to a text box on a form, which opens ok, showing the text - but when I scroll down with vertical scroll bar the following happens

- a file of 64K+ chars is OK
- a file of 240K chars is causing access to crash part of the way down, with an insufficient resources message

- i am loading the string by doing a readall on a textstream object, and I know the help for that warns about system resources, but it reads the string ok, and afterwards, i then set the scripting variables to "nothing"

I can open it by shelling with notepad, but I really wanted it readonly

Any thoughts?

WayneRyan
06-08-2008, 09:42 AM
Gemma,

The string variable can hold that much, but I think a TextBox is limited to
64K (65,535) characters.

Wayne

gemma-the-husky
06-08-2008, 10:52 AM
is there no way to display a large text file (string) then within access

raskew
06-08-2008, 10:57 AM
Could you not break it into several overlapping text boxes with Next and Previous buttons to control the boxes visibility?

Bob

georgedwilkinson
06-08-2008, 11:05 AM
I coulda sworn I had more data than that in a text box, but it was bound to a memo.

gemma-the-husky
06-08-2008, 12:22 PM
a) multiple text boxes would look worse i think, bob
b) a memo is defginitely only 64K characters, george

i think i will stick with using notepad