1 / 8

Guidelines for Setting Field Properties

Guidelines for Setting Field Properties. Each field has a number of properties, such as its name and data type, that you can set when you define the field. Access has rules for naming fields, choosing data types, and defining other field properties.

nia
Télécharger la présentation

Guidelines for Setting Field Properties

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Guidelines for Setting Field Properties • Each field has a number of properties, such as its name and data type, that you can set when you define the field. Access has rules for naming fields, choosing data types, and defining other field properties. • We’ll now look at guidelines for the following: • Naming fields and objects • Assigning field data types • Assigning field sizes

  2. Naming Fields and Objects You must name each field, table, and other object in an Access database. It’s best to choose a name that describes the purpose or contents of the field or object, so that later you can easily remember what the name represents. For example, the two tables in our current database are named Client and Contract, because these names suggest their contents.

  3. Naming Fields and Objects—Rules • The following rules apply to naming fields and objects: • A name can be up to 64 characters long. • A name can contain letters, numbers, spaces, and special characters, except for a period (.), exclamation point (!), accent grave (`), and square brackets ([ ]). • A name cannot start with a space. • A table or query name must be unique within a database. A field name must be unique within a table, but it can be used again in another table.

  4. Naming Fields and Objects—Tips • In addition, experienced users of databases follow these tips for naming fields and objects: • Capitalize the first letter of each word in the name. • Avoid extremely long names because they are difficult to • remember and reference. • Use standard abbreviations, such as Amt for Amount and Qty • for Quantity. • Do not use spaces in field names because these names • appear in column headings on datasheets and on labels on • forms and reports. By not using spaces you’ll be able to show • more fields at a time.

  5. Assigning Field Data Types You must assign a data type for each field. The data type determines what field values you can enter for the field and what other properties the field will have. Access has these ten data types: AutoNumber, currency, date/time, hyperlink, lookup wizard, memo, number, OLE object, text, and yes/no.Descriptions of the most commonly used data types appear on the next page.

  6. Most Commonly Used Field Data Types

  7. Assigning Field Sizes The field size property defines a field value’s maximum storage size for text, number, and AutoNumber fields only. The other data types have no field size property because their storage size is either a fixed, predetermined amount or is determined automatically by the field value itself. A text field has a default field size of 50 characters; you can also set its field size by entering a number in the range 1 to 255. When you use the number data type, you should set the field’s field size property based on the largest value you expect to store in that field. Access processes smaller data sizes faster using less memory, so you can optimize your database’s performance and its storage space by selecting the correct field size for each field.

  8. Assigning Field Sizes—Numbers • Field size property settings for number fields are: • Byte: Stores whole numbers from 0 to 255 in one byte. • Integer: Stores whole numbers from –32,768 to 32,767 in two bytes • Long Integer (default): Stores whole numbers from –2,147,483,648 to 2,147,483,647 in four bytes • Single: Stores positive and negative numbers to precisely seven decimal places and uses four bytes • Double: Stores positive and negative numbers to precisely 15 decimal places and uses eight bytes • Replication ID: Establishes a unique identifier for replication of tables, records, and other objects and uses 16 bytes • Decimal: Stores positive and negative numbers to precisely 28 decimal places and uses 12 bytes

More Related