Microsoft Access Data Types

Source: Internet
Author: User

The following table shows the Microsoft Access data types, data types used to create tables, and odbc SQL data types.

Microsoft Access Data Type

Data Type (createtable)

Odbc SQL data type

Bigbinary [1]

Longbinary

SQL _longvarbinary

Binary

Binary

SQL _binary

Bit

Bit

SQL _bit

Counter

Counter

SQL _integer

Currency

Currency

SQL _numeric

Date/time

Datetime

SQL _timestamp

Guid

Guid

SQL _guid

Long binary

Longbinary

SQL _longvarbinary

Long text

Longtext

SQL _longvarchar [2] SQL _wlongvarchar [3]

Memo

Longtext

SQL _longvarchar [2] SQL _wlongvarchar [3]

Number (fieldsize = Single)

Single

SQL _real

Number (fieldsize = double)

Double

SQL _double

Number (fieldsize = byte)

Unsigned byte

SQL _tinyint

Number (fieldsize = integer)

Short

SQL _smallint

Number (fieldsize = long integer)

Long

SQL _integer

Numeric

Numeric

SQL _numeric

Ole

Longbinary

SQL _longvarbinary

Text

Varchar

SQL _varchar [1] SQL _wvarchar [2]

Varbinary

Varbinary

SQL _varbinary

[1] Access 4.0 applications only. Maximum length of 4000 bytes. behavior similar to longbinary.

[2] ANSI applications only.

[3] Unicode and access 4.0 applications only.

Note

SqlgettypeinfoReturns ODBC data types. It will not return all Microsoft Access Data Types if more than one Microsoft Access type is mapped to the same odbc SQL data type. All conversions in appendix D ofODBC programmer's referenceAre supported for the SQL data types listed in the previous table.

The following table shows limitations on Microsoft Access data types.

Data Type

Description

Binary, varbinary, and varchar

Creating a binary, varbinary, or varchar column of zero or unspecified length actually returns a 510-byte column.

Byte

Even though a Microsoft Access number field with a fieldsize equal to byte is unsigned, a negative number can be inserted into the field when using the Microsoft Access driver.

Char, longvarchar, and varchar

A character string literal can contain any ANSI character (1-255 decimal). Use two consecutive single quotation marks ('') to represent one single quotation mark (').

Procedures shoshould be used to pass character data when using any special character in a character data type column.

Date

Date values must be either delimited according to the ODBC canonical date format or delimited by the datetime delimiter ("#"). otherwise, Microsoft Access will treat the value as an arithmetic expression and will not raise a warning or error.

For example, the date "March 5, 1996" must be represented as {d '2017-03-05 '} Or #03/05/1996 #; otherwise, if only 03/05/1993 is submitted, microsoft Access will evaluate this as 3 divided by 5 divided by 1996. this value rounds up to the integer 0, and since the zero day maps to 1899-12-31, This is the date used.

A pipe character (|) cannot be used in a date value, even if enclosed in back quotes.

Guid

Data Type limited to Microsoft Access 4.0.

Numeric

Data Type limited to Microsoft Access 4.0.

More limitations on data types can be found in data type limitations.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.