0% found this document useful (0 votes)
12 views

Data Types

Uploaded by

ßaɗsʜàʜ yt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Data Types

Uploaded by

ßaɗsʜàʜ yt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

You can use the DataType property to specify the type of data stored in a table

field. Each field can store data consisting of only a single data type.

Setting
The DataType property uses the following settings.

Setting Type of data Size

Note: Text was replaced by Short text Up to 255 characters or the length
in Access 2013.(Default) Text or set by the FieldSizeproperty,
Text combinations of text and numbers, as whichever is less. Microsoft Access
well as numbers that don't require does not reserve space for unused
calculations, such as phone numbers. portions of a text field.

Note: Short Text was introduced in


Up to 255 characters or the length
Access 2013. It replaced Text.
set by the FieldSizeproperty,
(Default) Text or combinations of text
Short Text whichever is less. Microsoft Access
and numbers, as well as numbers that
does not reserve space for unused
don't require calculations, such as
portions of a text field.
phone numbers.

Up to 63,999 characters. (If the


Memo field is manipulated through
Note: Memo was replaced by Long
DAO and only text and numbers
Memo Text in Access 2013.Lengthy text or
[not binary data] will be stored in it,
combinations of text and numbers.
then the size of the Memo field is
limited by the size of the database.)

Up to 63,999 characters. (If the


Long Text field is manipulated
Note: Long Text was introduced in
through DAO and only text and
Access 2013. It replaced
Long Text numbers [not binary data] will be
Memo.Lengthy text or combinations
stored in it, then the size of the Long
of text and numbers.
Text field is limited by the size of
the database.)

Numeric data used in mathematical


1, 2, 4, or 8 bytes (16 bytes if
calculations. For more information on
Number the FieldSize property is set to
how to set the specific Number type,
Replication ID).
see the FieldSize property topic.

Date/Time Date and time values for the years 100 8 bytes.

1
Setting Type of data Size

through 9999.

Currency values and numeric data


used in mathematical calculations
involving data with one to four
Currency decimal places. Accurate to 15 digits 8 bytes.
on the left side of the decimal
separator and to 4 digits on the right
side.

A unique sequential (incremented by


1) number or random number assigned
by Microsoft Access whenever a new 4 bytes (16 bytes if
AutoNumber record is added to a table. the FieldSize property is set to
AutoNumber fields can't be updated. Replication ID).
For more information, see
the NewValues property topic.

Yes and No values and fields that


Yes/No contain only one of two values 1 bit.
(Yes/No, True /False, or On/Off).

An object (such as a Microsoft Excel


spreadsheet, a Microsoft Word
Up to 1 gigabyte (limited by
OLE Object document, graphics, sounds, or other
available disk space)
binary data) linked to or embedded in
a Microsoft Access table.

Text or combinations of text and


numbers stored as text and used as a
hyperlink address. A hyperlink address
can have up to four parts: text to
Each part of the parts of a Hyperlink
display — the text that appears in a
Hyperlink data type can contain up to 2048
field or control. address — the path to
characters.
a file (UNC path) or page
(URL). subaddress — a location
within the file or page. screentip— the
text displayed as a tooltip.

Attachment Any supported type of file You can attach images, spreadsheet
files, documents, charts, and other
types of supported files to the

2
Setting Type of data Size

records in your database, much like


you attach files to e-mail messages.
You can also view and edit attached
files, depending on how the database
designer sets up the Attachment
field. Attachment fields provide
greater flexibility than OLE Object
fields, and they use storage space
more efficiently because they don't
create a bitmap image of the original
file.

Creates a field that allows you to


choose a value from another table or
from a list of values by using a list box
or combo box. Clicking this option The same size as the primary key
Lookup
starts the Lookup Wizard, which field used to perform the lookup,
Wizard
creates a Lookup field. After you typically 4 bytes.
complete the wizard, Microsoft Access
sets the data type based on the values
selected in the wizard.
You can set this property only in the upper portion of table Design view.

In Visual Basic , you can use the ADO Type property to set a field's data type
before appending it to the Fieldscollection.

Remarks
Memo, Hyperlink, and OLE Object fields can't be indexed.

3
4
Property

You can use the FieldSize property to set the maximum size for data stored in
a field set to the Text, Number, or AutoNumber data type.

Setting
If the DataType property is set to Text, enter a number from 0 to 255. The
default setting is 50.

If the DataType property is set to AutoNumber, the FieldSize property can be


set to Long Integer or Replication ID.

If the DataType property is set to Number, the FieldSize property settings and
their values are related in the following way.

Decimal
Storag
Setting Description precisio
e size
n

Byte Stores numbers from 0 to 255 (no fractions). None 1 byte

Stores numbers from -10^38-1 through 10^38-1


Decimal (.adp)Stores numbers from -10^28-1 through 10^28- 28 2 bytes
1 (.mdb, .accdb)

Stores numbers from -32,768 to 32,767 (no


Integer None 2 bytes
fractions).

Long (Default) Stores numbers from -2,147,483,648 to


None 4 bytes
Integer 2,147,483,647 (no fractions).

Stores numbers from -3.402823E38 to -1.401298E-


Single 45 for negative values and from 1.401298E-45 to 7 4 bytes
3.402823E38 for positive values.

Stores numbers from -1.79769313486231E308 to -


4.94065645841247E-324 for negative values and
Double 15 8 bytes
from4.94065645841247E-324 to
1.79769313486231E308 for positive values.

Replication
Globally unique identifier (GUID) N/A 16 bytes
ID

5
You can set this property only from the table's property sheet.

To set the size of a field from Visual Basic , use the DAO Size property to read
and set the maximum size of Text fields (for data types other than Text, the
DAO Type property setting automatically determines the Size property setting).

You might also like