Sie sind auf Seite 1von 3

Data Types in Access Data type is the type of data or description of data you are going to store in the

database.
Data Types Data Type Text Use Alphanumeric data. Use for text and for numbers that are not used in mathematical calculations. Use for names, addresses, and other relatively short pieces of text. Can store up to 255 characters. Long text. Use for long pieces of text, such as notes and long descriptions. Can store up to 64,000 characters. Numeric data. Use for numbers you want to use in mathematical calculations. Use for dates and times. Use for currency. Unique sequential numbers or random numbers automatically inserted when you create a record. Use to create a primary key. Logical data. Use when only one of two values is valid. Yes/No, True/False, etc. Use to store hyperlinks. Use to store attachments. Use to attach an OLE object such as a Word document, Excel spreadsheet, or PowerPoint presentation.

Memo Number Date/Time Currency AutoNumber Yes/No Hyperlink Attachment OLE Object

Input Mask

You can use the Input Mask property (for text or date/time data types only) to ensure that data gets entered in the correct format. For instance, you might want the phone number field to be in the format: (000) 000-0000. Using an input mask will not only ensure that the data is in a particular format, but it also saves you the trouble of typing certain characters, like parenthesis or hyphens. In the telephone number example, Access would not let you enter a number without an area code or would not let you save a record that did not contain the required number of characters. For common types of entries such as phone numbers, social security numbers, dates, or zip codes, use the Input Mask Wizard by clicking on the Build button in the Input Mask property box and then choose one of the available pre-defined Input Masks. For entries not supported by the Input Mask Wizard, you can create your own Input Mask manually. The Table below lists the characters available to create a manual Input Mask. The Input Mask contains 3 sections, each separate by a semicolon: 1. The mask characters listed in the table below. 2. Enter 1 if you want all literal placeholders to be saved with the data. Enter 0 (or leave blank) to save only the characters in the field. 3. Optional: Enter the placeholder that you want to appear on-screen as the user enters data. For example, lets say we had an employee number in the following format: ######-##. The first 6 characters are required and must be numbers, and the two characters after the dash can be letters or numbers and are optional. We also want an underscore (_) as a placeholder. Thus, our manual Input Mask would be entered as 000000-aa;1;_. See the breakdown below.

Character 0 not allowed). 9 allowed). # L ? A a &

Input Mask Characters Description Number (0 through 9, entry required; plus and minus signs are Number or space (entry optional; plus and minus signs not Number or space (entry optional; plus and minus signs allowed). Letter (A through Z, entry required). Letter (A through Z, entry optional). Letter or number (entry required). Letter or number (entry optional). Any character or a space (entry required).

C Any character or a space (entry optional). .,:;/ Decimal placeholder and thousands, date, and time separators. < Converts all characters that follow to lowercase. > Converts all characters that follow to uppercase. ! Characters are displayed from right to left, rather than from left to right. \ Causes the character that follows to be displayed as a literal character (for example, \A is displayed as just A). Password Creates a password entry text box. Any character typed in the text box is stored as the characters but is displayed as an asterisk (*). To Create an Input Mask 1. Select the table that contains the field for which you want to create an Input Mask. 2. Switch to Design View. 3. Click anywhere in the row of the field to receive the Input Mask. 4. To enter an Input Mask manually, type the desired characters in the Input Mask box in the Field Properties area. 5. To enter an Input Mask using the wizard: a. Click in the Input Mask box in the Field Properties area. b. Click the Build button. c. Chose the desired Input Mask from the list box. d. Click Next. e. Make any desired changes to the Input Mask characters or to the placeholder. f. Click Next. g. Select whether to store data with the literals or without the literals. h. Click Finish.

Das könnte Ihnen auch gefallen