[AccessD] variable string length vs fixed string length

Heenan, Lambert Lambert.Heenan at AIG.com
Wed Feb 26 12:30:00 CST 2003


Well in Access 97 you can certainly work with string > 64k. I just created
one that is 198,000 characters long with no problem.

However I'm puzzled when you say you have a file that's 5Mb, but only
contains about 100k characters. What's the other 4.9 Mb?

In any case I would suggest that you should not be assigning the whole file
to a string. Instead I think you should look to see if you can use Get() to
read in chunks of the file and process a part of it, then read in the next
chunk and so on. That way you will not be stressing the machine's virtual
memory when you process a very large file. Of course being able to do this
depends on what this external file is and how it is laid out.

Lambert

> -----Original Message-----
> From:	lyle.hannum at co.wake.nc.us [SMTP:lyle.hannum at co.wake.nc.us]
> Sent:	Wednesday, February 26, 2003 9:52 AM
> To:	accessd at databaseadvisors.com
> Subject:	[AccessD] variable string length vs fixed string length
> 
> Hi all,
> 
> From Access 2000 help:
> 
> There are two kinds of strings: variable-length and fixed-length strings.
> A variable-length string can contain up to approximately 2 billion (2^31)
> characters.
> A fixed-length string can contain 1 to approximately 64K (2^16)
> characters.
> 
> In a application I use a text file is placed into a string variable
> defined
> by
> Public myString as String.
> 
>  I was under the impression that this line defined a variable length
> string, but ran into a text file of approximately 5mb. This file would not
> fit. The file contains less than 100k characters. So I asked around the
> office and was told that actually the variable length string with 2bill
> char limit referenced here is for VB only, and that VBA has a hard limit
> of
> 64K chars.
> 
> The actual error is:
> Run Time Error 14: (out of string space)
> 
> Can anyone confirm this, or have any thoughts on the subject?
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list