[AccessD] variable string length vs fixed string length

lyle.hannum at co.wake.nc.us lyle.hannum at co.wake.nc.us
Thu Feb 27 11:31:00 CST 2003


Using Get sounds like an excellent idea. This is someone else routine which
I am now responsible for. I think that would be a modification I could make
without too big a rewrite. And help with system resources is a good thing
too. Thanks for the idea.

Lyle Hannum


                                                                                                      
                    "Heenan, Lambert"                                                                 
                    <Lambert.Heenan at AIG.com>       To:     "'accessd at databaseadvisors.com'"           
                    Sent by:                        <accessd at databaseadvisors.com>                    
                    accessd-admin at databasead       cc:                                                
                    visors.com                     Subject:     RE: [AccessD] variable string length  
                                                    vs fixed string length                            
                                                                                                      
                    02/26/03 01:28 PM                                                                 
                    Please respond to                                                                 
                    accessd                                                                           
                                                                                                      
                                                                                                      




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
_______________________________________________
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