• Microsoft Access Data Types


    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.

    NoteNote

    SQLGetTypeInfo returns 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 of the ODBC Programmer's Reference are 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 should 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 '1996-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.

  • 相关阅读:
    .Net基础:CLR基本原理
    行业软件开发商怎样来抢 BI 这块蛋糕?
    免费报表工具知多少?
    哪款报表工具更适合行业软件开发商?
    报表如何通过参数控制数据权限
    实现报表滚动到底部翻页效果
    报表 BI 选型的那些事
    零编码制作报表可能吗?
    为什么说当前报表开发的工作量主要在数据源环节?又如何解决呢?
    用存储过程和 JAVA 写报表数据源有什么弊端?
  • 原文地址:https://www.cnblogs.com/gleam/p/1764230.html
Copyright © 2020-2023  润新知