String Data Type

B

Brad

The text below is copied from Help in Access97.

How do you define a String data type as a Variable-Length String?

If you do

Dim x As String

x is only 255 characters. By definition below, a variable-length string is
2 billion.

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.

Note A Public fixed-length string can't be used in a class module.

The codes for String characters range from 0–255. The first 128 characters
(0–127) of the character set correspond to the letters and symbols on a
standard U.S. keyboard. These first 128 characters are the same as those
defined by the ASCII character set. The second 128 characters (128–255)
represent special characters, such as letters in international alphabets,
accents, currency symbols, and fractions.The type-declaration character for
String is the dollar sign ($).
 
K

Ken Snell [MVP]

ACCESS uses only as much memory as the text string is long. So,

Dim x As String

is the normal, preferred way to dimension a string variable. If x only
contains 255 characters, then it occupies only 255 characters worth of
memory.
 
D

Dirk Goldgar

Ken Snell said:
ACCESS uses only as much memory as the text string is long. So,

Dim x As String

is the normal, preferred way to dimension a string variable. If x only
contains 255 characters, then it occupies only 255 characters worth of
memory.

Well, 255 characters plus a few bytes of overhead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top