Data type of the "Go" Access Database

Source: Internet
Author: User
Tags ole access database

When you are developing a database generic component today, when you convert a C # database type to an Access database type, you find that the maximum length of the "text" type in Access is 255, and you need to use the "Memo" type when the length exceeds 255. A blog post describing the data type of an Access database is then forwarded as follows.

Original address: Http://blog.163.com/[email protected]/blog/static/36024777200932210508692/

Data type of an Access database

First, the data type

The Access database provides 10 data types for the fields, and their usage and amount of storage space are as follows:

1. Text: The data used to enter text or text in combination with a number, up to 255 characters (bytes), and a default value of 50. In Access, each character and all special characters (including Chinese punctuation marks) are counted as one character.

Presentation method: Enclosed in English single quotation marks (') or British double quotation marks (""). Example: ' Wang Gang ', ' Accounting 2 class ', ' 3246291 ' and so on.

2. Currency type (Currency): Used to store currency values, which account for 8 bytes, and are prohibited from rounding in calculations.

3. Number: Used for data that can be numerically calculated, except for currencies. Numeric fields are 1, 2, 4, 4, 8, 16, and 12 bytes per field size, integer, long, single, double, replication ID, and decimal. 7 cases.

Presentation method: Write directly. Example: 3246291

4. Date/Time Type (date/time): Used to store date and/or time values, accounting for 8 bytes.

Presentation method: Enclose the English character # number. Examples: #2010 -02-25#, #02/25/2010#, #2010-02-25 15:30#, #2010 -02-25 3:30pm#, #15:30# are legal representations. Note, however, that a space is left between the date and time.

5. AutoNumber (AutoNumber): Used to automatically insert a sequence number (increment 1 or random number each time) when adding a record, the default is a long integer, or you can change to a synchronous replication ID. Automatic numbering cannot be updated.

6. Yes/No (yes/no): Used to represent a logical value (yes/No, true/false), accounting for 1 bytes.

Representation method:. T.. F. True false

7. Memo Type (Memo): Used for long text or long text with a number (greater than 255 characters) of the Union, the maximum is 65,535 characters.

8. OLE object Type (OLE objects): Used for OLE objects created in other programs using the OLE protocol (such as Word documents, Excel spreadsheets, pictures, sounds, and so on), up to 1GB (limited by disk space).

9. Hyperlink type (Hyper link): Used to store a hyperlink address with a maximum of 64,000 characters.

10. Lookup Wizard Lockup: Let the user select a value from another table or list of values through a combo box or list box, and the actual field type and length depend on the source of the data.

Attachment A lists the applicable scopes and their default widths (that is, the default storage space) for all access data types.

Second, how to determine the field data type

1, money-related, with currency, and money-independent but need numerical calculation of the selected digital type, no numerical calculation and no more than 255 characters of the selected text type, more than 255 characters of the selected note type.

2, if only two determined values to choose from, you can use Yes/no type, you can also use text type. Other types, such as date type, have obvious meanings and are no longer described.

Data type of the "Go" Access Database

Related Article

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.