Inserting objects into a field with the ole data type. Using data type OLE Object Field (OLE Object) What is special about the ole field


The result of filling out the table, where the type of object is indicated in the corresponding field - Bitmap. To view an embedded object, simply place the cursor in the appropriate field and double-click.

To display the contents of the field as an icon representing the document file in the window (Fig. 3.20), check the box As an icon(Display As Icon). The icon can be used to represent related object.

Entering Logically Related Records

Let's enter several logically interrelated records into the GROUP and STUDENT tables.

The GROUP and STUDENT objects are connected by one-to-multivalued relationships, but until a data schema is created in which connections between tables are established, the system cannot control the logical relationship of the input data. Therefore, in order to obtain a complete database in which all records of a subordinate table have a logically connected master record, the user needs to track the logical connections of the records himself. When entering a subordinate record into a table, the student needs to check the presence of a record in the main table group with a key whose value matches the value of the relationship field (foreign key) of the subordinate record being entered. That is, when adding a record about a student in group 221, it is necessary that the group with this number is already represented in the GROUP table.

When directly entering records into a table that are logically related to records in another table, it is useful to display both tables on the screen (Figure 3.21).

To simultaneously display open tables, you can use the command Top down or From left to right on the menu Window.

Using a combo box when entering records

One way to enter sub-records only when there is a related record in the main table is to use a combo box in the sub-table that includes the values ​​of the main table's field. Let's create a list field in the student table for the NG (group number) field, built on the basis of the group table key. To do this, open table I student in design mode. Place the cursor in the NG field on the Data Type column, open the list and select the line Substitution Wizard(see Fig. 3.5). In the wizard window that opens Creating a Substitution check the box The Lookup Column object will use the values ​​from the table or query. This will build a list based on the values ​​from the table.

In the next wizard window, select the GROUP table, the values ​​from which will be used to build the field list. Next, select the column from which the list will be formed.

In the next windows of the wizard, select the desired width of the list column and its label. This completes the creation of the combo box by the wizard. The list parameters prepared by the wizard are displayed in the properties window of the NG field on the tab Substitution.

Now, when entering data into the student table, you can use a list that displays all the values ​​of the NG field contained in the group table. Entering a value in the NG field is done by selecting the desired value from the list. The presence of a combo box does not prohibit entering into the NG field values ​​not specified in the list. However, if, when defining list parameters in the designer window, in the Field properties on the tab Substitution select for property Limit yourself to a list value Yes, then entering values ​​not included in the list will become impossible. The system will monitor this situation and, in case of deviation from the list values, will issue a message shown in Fig.

This way, the user will be forced to adhere to only the values ​​presented in the list, and only related records will be entered into the subtable. Thus, the use of lists not only provides convenient input, but also avoids many mistakes.

Let's look at another example of using a combo box. Let's transform the table studying the field KP - subject code into a combo box. To do this, open the table in design mode, place the cursor in the KP field on the column Data type, open the list of this column and select the line Substitution Wizard. In a dialogue with the wizard, we will select the main table in relation to the study table, the subject table, based on the data of which a list is created, and the fields included in the list: CP (subject code) and NP (subject name). In addition, let's leave the checkbox checked, as the wizard suggests. The result of the master's work is presented on.

If you check the box Hide key column (recommended), then the width of the first column of the list is set to zero. Moreover, the property Limit yourself to a list can only take one value - Yes.

Defining a combo box with such parameters leads to the display in the table field of the CP instead of the values ​​of the key field of the values ​​of the second field of the list - the NP field (item name). In Fig. Figure 3.30 shows how the STUDY table displays the Subject Code and Timesheet combo boxes. teacher when the width of the attached column is zero.

Thus, the use of combo boxes will help avoid errors when entering related records into tables, both because the tables can display meaningful values ​​instead of keys, and because the input is limited to the set of values ​​in the list.

Attention!

When you create combo boxes, the Lookup Wizard automatically creates a relationship between the table in which you create the combo box and the source table of the list values. This relationship can be seen in the Data Schema window by clicking the Show all relationships toolbar button.

Obviously, in a database with a complex structure, when entering data directly into tables, reliable and correct data maintenance is not guaranteed. In the considered example of a database, the Educational process when entering data into lower-level tables requires | keep track of multiple upstream ones. With a large amount of data this is very difficult.

Data schema in Access

In Access, the process of creating a relational database involves creating a data schema. Data Schema clearly displays the logical structure of the database: tables and connections between them, and also ensures the use of connections established in it when processing data.

For a normalized database based on one-to-one and one-to-one relationships between tables, provisioning parameters can be set in the data schema for relationships of such tables by the primary key of the main table or by a unique index coherent integrity.

When maintaining the integrity of related data, it is not allowed to have a record in a subtable if there is no associated record in the master table. Accordingly, during the initial loading of the database, as well as adjusting, adding and deleting records, the system allows the operation to be performed if it does not lead to a violation of integrity.

The relationships defined in the data schema are automatically used to combine tables when developing multi-table forms, queries, and reports, significantly simplifying the process of their construction.

A data diagram in Access is not only a means of graphically displaying the logical structure of a database (see Figure 2.16), it is actively used by the system in the process of working with the database. During any processing of data from several interrelated tables, the system uses the relationships between tables stored in the data schema, freeing the user from the need to specifically inform the system about the presence of a particular relationship when constructing multi-table objects. Once specified in the data schema, the connections are used automatically by the system.

A relational database, created according to the design of the canonical data model, consists of normalized tables. Such a database ensures that there is no duplication of data in interconnected tables and, accordingly, the volume of stored data is minimized. In the process of loading and updating the database, obtaining information on queries and outputting reports, as well as solving most problems, simultaneous access to several interrelated tables is required. Creating a data schema allows you to simplify the design of multi-table forms, queries, reports and data access pages and ensure the maintenance integrity interrelated data when adjusting tables.

Relationships between tables

When a user creates an Access data schema, it defines and remembers the relationships between tables. Based on interrelated tables, the system automatically combines data to create forms, queries, reports, and data access pages. The database data schema is graphically displayed in its own window, where tables are represented by lists of fields, and connections are represented by lines between fields of different tables.

One-to-multiple (1:M) or one-to-one (1:1) relationships

The data schema is primarily focused on working with tables that meet the normalization requirements, between which one-to-multiple (1:M) or one-to-one (1:1) relationships can be established. Cohesive integrity can be automatically maintained for such tables. Therefore, it is advisable to build a data diagram in accordance with the information-logical model.

When building a data schema, Access automatically determines the type of relationship between tables based on the selected connection field. If the field you want to relate to is a unique key in both tables, Access identifies the relationship one to one. If a relationship field is a unique key in one table (the main table of the relationship), but in another table (the subordinate table of the relationship), it is not a key or is included in a composite key, Access identifies the relationship one-to-many between records of the main and subordinate tables. Only in this case can you set automatic maintenance of the integrity of connections.

Comment

If a unique index is used instead of a key field to link tables, the system also detects the presence of a 1:M relationship between the tables and allows you to set integrity parameters.

Connections-associations

A join relationship can be established between two tables with the same field using this field, called communication key. For a join relationship, you can choose one of three ways to combine table records:

  1. Merging records only if the related fields of both tables match (produced by default).
  2. Merging records when the related fields of both tables match, as well as all records of the first table for which there are no related fields in the second, with an empty record of the second table.
  3. Merging records when the related fields of both tables match, as well as all records of the second table for which there are no related fields in the first, with an empty record of the first table.

To establish a connection, any of the listed joining methods can be selected, regardless of what relationships the tables being linked are in: 1:1, 1:M, or the type of relationship cannot be determined by the system. For example, if you select a non-key field or a field that is part of a composite key as a relationship field in the main table, Access reports that the relationship type cannot be determined. But in this case, it is also possible to establish any type of union connection between the tables. When a data schema defines a relationship between two tables, a join relationship of the first type is established between these tables by default, regardless of the type of relationship.

A join relationship provides a union of table records that have the same values ​​in the relationship field. Moreover, provided that the values ​​in the connection field are equal, each record from one table is merged with each record from another table. In addition, if the second or third merging option is selected, then it also includes records from the subordinate table for which there are no logically related records in the main table. The last two options are often necessary when solving practical problems.

Ensuring data integrity

When creating a data schema, the user includes tables in it and establishes relationships between them. If the tables being linked are in a 1:1 and 1:M relationship, you can enable the link to ensure cohesive data integrity and automatically cascade updates and delete related records.

Ensuring cohesive data integrity means that when you make changes to a database, Access ensures that the following conditions are met for related tables:

  • a record with a link key value that does not exist in the main table cannot be added to a subordinate table;
  • You cannot delete a record in the main table unless the related records in the subordinate table are deleted;
  • You cannot change the relationship key values ​​in a master table record if there are records associated with it in the child table.

If a user attempts to violate these conditions by adding or deleting records or updating key data in linked tables, Access displays a corresponding message and prevents the operation from being completed.

Access 2010 has the ability to add objects to a field with OLE data type. In the case where the data type is specified as OLE (Object Linking and Embedding– object binding and embedding), then the Access DBMS retains the external an object in the general database file, allocating for its storage as much space as this object occupies in the form of a separate file. Under objects You should understand files created as applications in graphic editors, video clips, MS Office applications, etc. When a table is filled with data that is an object, a message about the program that can be used to open this object is generated in the corresponding position of the field with the OLE data type. Displaying an object will be carried out only in forms and reports.

For embedding an object in the field with OLE data type you need to open the table in "Constructor" mode. Add a new field, for example “Product photo.” Select data type "OLE Object Field", and then save the table.

Then in "Table" mode in the line for entering data, click the right mouse button, in the menu that opens, select the line with the command, which will open a dialog box (Fig. 3.38, Fig. 3.39).

Rice. 3.38 Inserting an object

Rice. 3.39 Dialog box for adding a new object to an Access table

Remember that there are two options for embedding objects as data. The first option involves using standard applications to create a file that Access supports, the second option is to insert an object, which allows you to use any file as a data source (Fig. 3.40).

Rice. 3.40 Adding a new object to an Access table from a file

1. Creating an object from a file.

When it comes to data that is an object for the database and is an external file, it is required to have these files. Therefore, you will need to create several files in order to see how they are displayed in the database in the future, and also try to change these files. For example, if you have a photograph of an object in the file Monitor.jpg(jpg is a universal photo format). In order for this file to be saved in the database, you should check the box (Fig. 3.40) "Create from file", after which the window shown in Figure 3.41 will appear. Using a button "Review" you should select the required file.

Rice. 3.41 Finding a file when creating an object in the database

In the corresponding line for the field, for example, "Product photo" the word will appear "Package", this means that the file is tied to the application that created it. Therefore, when viewing a database, be it a query, form or report, the user will see an image of the file as an icon, and when double-clicking on this image, the system will first find the application and then display the contents of the file (in this example, a photo) in it. . The exception is image files saved with the extension .bmp(bit map format). However, it should be recalled that files created in Microsoft applications will be displayed immediately in forms and reports. The conclusion is simple, photographs can be inserted into applications such as Paint, Word, Power Point, saved as separate files, and then connected as an object to the database. Try creating multiple photo and text files using different Windows editors. For example, you can open a Word document, insert a photo from the file, add text, and then save as: Monitor.docx(Fig. 3.42).

Rice. 3.42 Photo file created in Word

2. Creation of new objects.

By creating new objects in the database, you should mean using an application in which the file is created and then included in the field describing the type of this OLE. To start the mode for creating new objects, you need to open the table in "Table" mode, select option "Create new" in the dialog box (Fig. 3.39), and then select in the list "Object type"(required application). The list of applications that Access supports for creating an object is in the list (Fig. 3.43), which will open after running the command "Insert object" .

Rice. 3.43 List of Access object types that can be used to create files

The convenience of using applications to create objects in the form of files is that in the future these files can be used autonomously or corrected in the database.

Let's consider object creation option for the database, using paint applications

For example, it is necessary to create an object with an image of a company and text, which the database user can later replace or correct. To do this you need to select from the list Bitmap Image object, further technology for creating an object is shown in Figure 3.44.

1. Open the Paint application

2. Insert a photo from a file.

3. Add text (if necessary).

4. Save as a file.

5. Close the application.

Rice. 3.44 Technology for creating an object in the Paint application

Exercise 3.11

1. In the table " Goods» in mode "Constructor" add a new column named "Product photo", data type " OLE Object Field", save changes.

2. In mode "Table" in field "Product photo" select a line "Insert object from file", select (put a dot) "Create new" and from the drop-down list specify Microsoft Word document. This will open a text editor MS Word, here you need to insert a picture corresponding to the product in this line. Select pictures from the list that is stored directly in the editor (the “Insert” tab, the “Picture” icon, the “Start” button in the dialog box on the right), or insert a picture from other programs. You can use the Paint application (Bitmap Image object), where you can draw the product yourself. Close the created file, it will automatically be linked to your database, to the line in which it was inserted.

3. Follow this procedure for all lines yours "Products" tables.

4. Save your changes.

Control questions

1. What objects can be inserted into a database with an OLE data type?

2. How can I insert a photo into a table in Table mode?

3. Where will the photo appear in the database?

4. What is the difference between the “Create a new object” method and the “Create from file” method?

5. How to place a product photo file in the database if it has the extension .png?

6. Is it possible to edit a file that is inserted as an object into a database directly in the computer’s file system?

7. How to insert a presentation into the database?

8. Which application objects can be inserted into the database?

Every table in Access is made up of fields. Field properties describe the characteristics and behavior of the data added to it. The data type of a field is the most important property that determines what data can be stored in the field. This article describes the data types and other field properties available in Access and provides additional information in the Data Types reference topic.

In this article

General information

Sometimes the data types may not be obvious, for example, a field with the Text data type may store data consisting of text and numbers. But a field with a Number data type can only store numeric data. So you need to know which properties are used for each data type.

The data type of a field determines many other important characteristics of the field, including:

    formats that can be used in the field;

    the maximum size of the value in the field;

    how the field is used in expressions;

    possibility of field indexing.

Depending on how you create a new field, the field's data type may be predefined or selectable. For example, if when creating a field in Datasheet view you:

    you use an existing field from another table, the data types are already defined in it or in the template;

    enter data in a blank column (or field), Access assigns a data type to the field based on the values ​​you enter, or you can assign a data type and format to the field;

    on the tab Changing fields in Group Fields and Columns choose a team Add fields Access displays a list of data types to choose from.

When to use which data type?

A field's data type can be thought of as a set of characteristics that apply to all values ​​in that field. For example, values ​​in a text field can only contain letters, numbers, and some punctuation. Additionally, the text field can contain a maximum of 255 characters.

Advice: Sometimes it looks like the data in a field is one type, but in fact it is data of a different type. For example, a field appears to contain numeric values, but is actually text values ​​representing room numbers. Expressions are often used to compare or convert between values ​​of different data types.

The tables below show the formats available for each data type and describe the formatting results.

Main types

Format

Displayed data

Text

Short alphanumeric values, such as last name or postal address. Please note that as of Access 2013, the text data type has been renamed to Short text.

Numeric, Large number

Numeric values, such as distances. Remember that there is a separate data type for monetary values.

Monetary

Monetary values.

Logical

Values ​​"Yes" and "No", as well as fields containing only one of the two values.

date and time

Date and time values ​​from 100 to 9999 years.

Rich text

Text, or a combination of text and numbers, that is formatted with color and font controls.

Calculated field

Calculation results. A calculation can reference other fields in the same table. Calculations are created using the Expression Builder. Calculated fields first appeared in Access 2010.

The attachment

Attach images, spreadsheet files, documents, charts, and other supported file types in database records (as in email messages).

Text or a combination of text and numbers saved as text and used as a hyperlink address.

MEMO field

Long blocks of text. A typical use case for the MEMO field is a detailed description of a product. Please note that as of Access 2013, the MEMO data type has been renamed to Long Text.

Substitution

A list of values ​​that are returned from a table or query, or a set of values ​​that you specified when you created the field. The Lookup Wizard starts, allowing you to create a lookup field. Depending on the selections you make in the wizard, the data in the lookup field can be text or numeric.

Lookup fields have an additional set of properties that are found on the Substitution in area Field properties.

Note: Attachments and calculated data are not available in MDB files.

Numerical

Format

Displayed data

Are common

Numbers without additional formatting (exactly as they are stored).

Monetary

Regular monetary values.

Euro

Regular monetary values ​​in EU format.

Fixed

Numeric data.

Standard

Numeric data with decimal places.

Percent

Values ​​are in percentages.

Exponential

Computing.

date and time

Format

Displayed data

Short date format

Date in short format. Depends on regional date and time settings. For example, 03/14/2001 for Russia.

Medium date format

Long date format

Date in long format. Depends on regional date and time settings. For example, March 14, 2001 for Russia.

Time (12 hours)

Time is in 12-hour format only, which will accommodate changes in regional date and time settings.

Medium time format

Time in 12-hour format, followed by AM (am) or PM (after noon).

Time (24 hours)

Time is in 24-hour format only, which will accommodate changes in regional date and time settings.

Logical

OLE object OLE objects, such as Word documents.

Field Size property

After you create a field and specify a data type for it, you can configure additional field properties. The available additional properties depend on the field's data type. For example, you can adjust the size of a text field using the property Field size.

For numeric and currency fields, the property Field size is especially important because it determines the range of field values. For example, a one-digit numeric field can only contain integers in the range 0 to 255.

Property Field size also determines how much disk space each numeric field value takes up. Depending on the field size, a number can occupy 1, 2, 4, 8, 12 or 16 bytes.

Note: Variable size values ​​are possible in MEMO fields and text fields. For these data types, the property Field size specifies the maximum size of available space for a single value.

Data types in relationships and joins

A table relationship is a relationship between common fields in two tables. The relationship can be one of the following types: one to one, one to many, many to many.

A join is an SQL operation that combines data from two sources into a single record in a query recordset based on the values ​​of a specified common field in the sources. A join can be one of the following types: inner join, left outer join, right outer join.

When you create a relationship between tables or add a join to a query, the data types in the fields being joined must be the same or compatible. For example, you won't be able to create a join between a number field and a text field, even if the values ​​in those fields are the same.

When using a link or join, fields with the Counter data type are compatible with fields of the numeric type if the property Field size last set value Long integer.

You cannot change the data type or property of a field that is involved in a relationship between tables. Field size. To change a property Field size, temporarily remove the connection. But after you change the data type, you won't be able to create the relationship again until you change the data type of the associated field. For more information about tables, see the article Understanding tables.

Data Type Reference

The data type applied to a field contains a set of properties that you can select. For more information, click data types below.

The attachment

Purpose. Used in a field that allows you to attach files and images to a post. For example, if you have a database of work contacts, you can use the attachment field to attach resumes or photos of contacts. For some file types, Access compresses attachments that you add. The Attachment data type is only available in ACCDB format databases.

Types of attachments compressed in Access

When you attach any of the following file types to a database, Access compresses it.

    Bitmaps, such as BMP files

    Windows metafiles, including EMF files

    EXIF files

  • TIFF files

You can attach a variety of files to a post. But some types of files may pose a threat and are therefore blocked. Typically, you can attach any file created in one of the Microsoft Office applications, as well as log files (LOG), text files (TEXT, TXT), and compressed ZIP files. For a list of supported image file formats, see the table later in this section.

List of blocked file types

Access blocks the following types of attachments:

Counter

Purpose. The counter field allows you to specify a unique value, that is, it is used for only one purpose - to make each record unique. The most common use of this field is as a primary key, especially if there is no suitable natural key (a key based on the data field).

The value in the counter field takes from 4 to 16 bytes depending on the property value Field size.

Let's say you have a table that stores contact data. You can use contact names as the primary key for this table. But how to handle two contacts with the same names? Names are not suitable as primary keys because they are often not unique. By using the counter field, each record is guaranteed to have a unique identifier.

Note: Do not use the counter field to store the number of records in a table. Counter values ​​are not reused, so when records are deleted, there are gaps in the count. And the exact number of records can be easily obtained using the totals line in the table view.

Supported Field Properties

Property

Usage

Field size

Determines the amount of space allocated for each value. Only two values ​​are allowed for counter fields.

    The Long Integer value is used for counter fields that are not used as replication identifiers. This is the default value. It should only be changed if you are creating a replication ID field.

    Note: Replication is not supported in newer database formats such as ACCDB.

    This value makes counter fields compatible with other Long Integer numeric fields when used in relationships and joins. Each field value takes 4 bytes.

    Meaning Replication code applies to counter fields that are used as replication identifiers in a database replica. Use this value only if you are running or implementing a replicated database design.

    Each field value takes 16 bytes.

New values

Determines whether the counter field should be incremented with each new value or whether random numbers should be used. Select one of the options below.

    Consistent. Values ​​start at 1 and increase by 1 for each new entry.

    Random. It starts with a random value and assigns a random value to each new entry. The values ​​are of size Long Integer and fall in the range –2,147,483,648 to 2,147,483,647.

Format

When using a counter field as a primary key or replication identifier, this property should not be set. Otherwise, select an appropriate number format.

Signature

Indexed

    Yes (matches allowed).

    No.

Note: Without a unique index, you can enter duplicate values, which can break the relationships of which the key is a part.

Using property Indexed

Smart tags

Text alignment

Computable

Purpose. Used to store calculation results.

A calculation can reference other fields in the same table. Calculations are created using the Expression Builder. Computed data types were first introduced in Access 2010. The calculated data type is only available in ACCDB format databases.

Supported Field Properties

Property

Usage

Expression

The result of this calculation will be stored in a calculated column. If this column has been saved, then only saved columns can be used in this expression.

Result type

The data type that is used to display the result of a calculation.

Format

Most often the meaning Format is set according to the result type.

Number of decimal places

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Short captions are most effective.

Text alignment

Determines the default alignment of text in a control.

Monetary

Purpose. Used to store monetary data.

Data in the currency field is not rounded during calculations. The value in the currency field contains up to 15 digits to the left of the decimal point and 4 digits to the right. Each currency field value takes 8 bytes.

Supported Field Properties

Property

Usage

Format

Determines how a field appears in tables, forms, and related reports when displayed on screen or printed. Any valid number format can be used. Most often for properties Format value is set Monetary.

Number of decimal places

Determines the number of decimal places to display.

Input mask

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Short captions are most effective.

Default value

Condition on value

Error message

Mandatory

Indexed

Indicates whether the field is an index. There are three possible values.

    Yes (no overlap allowed). A unique index is created for the field.

    Yes (matches allowed). A non-unique index is created on the field.

    No. All indexes from the field are removed.

Note: Do not change this property for a field that is used as a primary key.

Using property Indexed It is possible to create an index on a single field, but this is not possible for all index types. For example, you cannot use this property to create an index on multiple fields.

Smart tags

Adds a smart tag to the field. Smart tags have been deprecated since Access 2013.

Text alignment

Determines the default alignment of text in a control.

date and time

Purpose. Used to store date and time values.

Supported Field Properties

Property

Usage

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Short captions are most effective.

Default value

Automatically sets this field to the specified value when a new record is added.

Format

Determines how a field appears in tables, forms, and related reports when displayed on screen or printed. You can use a built-in format or create your own.

List of built-in formats

    Full date format. By default, if the value is only a date, then no time is displayed, and if the value is only a time, then no date is displayed. This value is a combination of the short date format and the long time format.

    Examples

    • 03.04.2007 17:34:00

    Long date format. Corresponds to the long date format defined in the Windows regional settings. Example: Saturday, April 3, 2007

    Short date format. Corresponds to the short date format defined in the Windows regional settings. Example: 04/03/2007.

    Warning: If the short date format is specified in regional settings as "dd.mm.yy", dates from 01/01/00 to 12/31/29 are assumed to be in the twenty-first century (that is, years from 2000 to 2029), and dates from 01/01/30 to 12/31/99 - to the twentieth century (that is, these are the years from 1930 to 1999).

    Long time format. Corresponds to the parameter on the tab Time in Windows regional settings. Example: 17:34:23.

    Medium time format. Time in hours and minutes, with time separator, followed by AM or PM. Example: 5:34 PM.

    Short time format. Time in hours and minutes with time separator in 24-hour format. Example: 17:34.

List of elements that can be used in custom formats

To create a custom format, specify any combination of the following elements. For example, to display the week of the year and the day of the week, enter NN/n.

Important: Custom formats that are incompatible with the date and time settings specified in Windows regional settings are ignored. For more information about Windows regional settings, see Windows Help.

Separator elements

Note: Separators are defined in Windows regional settings.

: Time component separator. For example, hh:mm

. Separate date components. For example, mm.yyyy

Any short string of characters enclosed in quotation marks ( "" ) Custom delimiter. Quotes are not displayed. For example, when you enter "," a comma is displayed.

Date Format Elements

d The day of the month, consisting of one or two digits (from 1 to 31).

dd The day of the month, consisting of two digits (from 01 to 31).

ddd Abbreviated name of the day of the week (Mon – Sun).

ddddd Full name of the day of the week (Monday - Sunday).

n Number of the day in the week (from 1 to 7).

NN Week number in the year (from 1 to 53).

M Month number, consisting of one or two digits (from 1 to 12).

MM Month number, consisting of two digits (from 01 to 12).

MMM The first three letters of the name of the month (Jan - Dec).

MMMM Full name of the month (January – December).

To Number of the quarter in the year (from 1 to 4).

G Number of the day in the year (from 1 to 366).

yy The last two digits of the year number (01 to 99).

yyyy Full year number (from 0100 to 9999).

Time Format Elements

h Hour value, consisting of one or two digits (from 0 to 23).

hh Hour value, consisting of two digits (from 00 to 23).

m A minute value consisting of one or two digits (from 0 to 59).

mm Minute value, consisting of two digits (00 to 59).

With Seconds value, consisting of one or two digits (0 to 59).

ss Seconds value, consisting of two digits (from 00 to 59).

Clock Format Elements

AM/PM 12-hour time format with the addition of capital letters "AM" or "PM" (for example, 9:34 PM).

am/pm 12-hour time format with the addition of lowercase "am" or "pm" (for example, 9:34 pm).

A/P 12-hour time format with the addition of capital letters "A" or "P" (for example, 9:34 P).

a/p 12-hour time format with the addition of lowercase letters "a" or "p" (for example, 9:34 p.m.).

AMPM 12-hour time format using the appropriate AM/PM designator defined in the Windows regional settings.

Built-in formats

c Same as built-in full date format.

ddddd Same as the built-in short date format.

dddddd Same as the built-in long date format.

ttttt Same as built-in long time format.

IME mode

IME Suggestion Mode

Indexed

Indicates whether the field is an index. There are three possible values.

    Yes (no overlap allowed). A unique index is created for the field.

    Yes (matches allowed). A non-unique index is created on the field.

    No. All indexes from the field are removed.

Note: Do not change this property for a field that is used as a primary key.

Using property Indexed It is possible to create an index on a single field, but this is not possible for all index types. For example, you cannot use this property to create an index on multiple fields.

Input mask

Allows you to display special characters to control data entry. For example, an input mask might display a dollar sign ($) at the beginning of a field.

Mandatory

Requires mandatory data entry in the field.

Show date picker

Specifies whether the element should be displayed Select date.

Note: If you use an input mask for a date and time field, the element Select date is not available regardless of the value of this property.

Smart tags

Adds a smart tag to the field. Smart tags have been deprecated since Access 2013.

Text alignment

Determines the default alignment of text in a control.

Condition on value

Allows you to enter an expression that must be true when adding or changing the value of this field. Used in combination with the Error Message property.

Error message

Allows you to enter a message to display if the value you enter does not match the expression in the Value Condition property.

Hyperlink

Purpose. Used to store hyperlinks such as an email address or a website URL.

Supported Field Properties

Property

Usage

Blank lines

Add only

    Yes. Changes are tracked. To view the history of a field's values, right-click the field and select Show Column History.

    No. Changes are not tracked.

Warning: Warning. If you set this property to No

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Short captions are most effective.

Default value

Automatically sets this field to the specified value when a new record is added.

Format

Determines how a field appears in tables, forms, and related reports when displayed on screen or printed. You can define a custom format for a hyperlink field.

IME mode

Controls character conversion in East Asian versions of Windows.

IME Suggestion Mode

Controls sentence conversion in East Asian versions of Windows.

Indexed

Indicates whether the field is an index. There are three possible values.

    Yes (no overlap allowed). A unique index is created for the field.

    Yes (matches allowed). A non-unique index is created on the field.

    No. All indexes from the field are removed.

Note: Do not change this property for a field that is used as a primary key.

Using property Indexed It is possible to create an index on a single field, but this is not possible for all index types. For example, you cannot use this property to create an index on multiple fields.

Mandatory

Requires mandatory data entry in the field.

Smart tags

Adds a smart tag to the field. Smart tags have been deprecated since Access 2013.

Text alignment

Determines the default alignment of text in a control.

Unicode Compression

Condition on value

Allows you to enter an expression that must be true when adding or changing the value of this field. Used in combination with the Error Message property.

Error message

Allows you to enter a message to display if the value you enter does not match the expression in the Value Condition property.

MEMO

Purpose. Used to store a block of formatted text longer than 255 characters. Please note that as of Access 2013, the MEMO data type has been renamed to Long text.

Supported Field Properties

Property

Usage

Blank lines

When set to Yes, allows the entry of an empty string ("") in a text box, hyperlink field, or MEMO field.

Add only

Indicates whether field value changes should be monitored. There are two possible values:

    Yes. Changes are tracked. To view a history of field values, right-click the field and select the item Column Log Display.

    No. Changes are not tracked.

    Warning: If you set this property to No, the existing field history is deleted.

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Advice: Short captions are most effective.

Default value

Automatically sets this field to the specified value when a new record is added.

Format

Determines how a field appears in tables, forms, and related reports when displayed on screen or printed. You can define a custom format for the MEMO field.

IME mode

Controls character conversion in East Asian versions of Windows.

IME Suggestion Mode

Controls sentence conversion in East Asian versions of Windows.

Indexed

Indicates whether the field is an index. There are three possible values.

    Yes (no overlap allowed). A unique index is created for the field.

    Yes (matches allowed). A non-unique index is created on the field.

    No. All indexes from the field are removed.

Note: Do not change this property for a field that is used as a primary key.

Using property Indexed It is possible to create an index on a single field, but this is not possible for all index types. For example, you cannot use this property to create an index on multiple fields.

Mandatory

Requires mandatory data entry in the field.

Smart tags

Adds a smart tag to the field. Smart tags have been deprecated since Access 2013.

Text alignment

Determines the default alignment of text in a control.

Unicode Compression

Compresses the text stored in this field (if less than 4096 characters are stored).

Condition on value

Allows you to enter an expression that must be true when adding or changing the value of this field. Used in combination with the Error Message property.

Error message

Allows you to enter a message to display if the value you enter does not match the expression in the Value Condition property.

Numerical

Purpose. Used to store a numeric value that is not monetary. If field values ​​can be used in calculations, choose a numeric data type.

Supported Field Properties

Property

Usage

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Short captions are most effective.

Number of decimal places

Determines the number of decimal places to display.

Default value

Automatically sets this field to the specified value when a new record is added.

Field size

Select one of the options below.

    Byte. Used for integers from 0 to 255. Requires 1 byte for storage.

    Integer. Used for integers from –32768 to 32767. Requires 2 bytes for storage.

    Long integer. Used for integers from –2,147,483,648 to 2,147,483,647. Requires 4 bytes for storage.

    Advice: Use margin size Long integer when you create a foreign key to associate a field with a primary key field of another table that has a Counter data type.

    Single floating point. Used for floating point numbers from –3.4 x 1038 to 3.4 x 1038, which have up to seven significant digits. Storage requires 4 bytes.

    Double floating point. Used for floating point numbers from –1.797 x 10308 to 1.797 x 10308, which have up to fifteen significant digits. Storage requires 8 bytes.

    Replication code. Used to store a globally unique identifier required for replication. Storage requires 16 bytes. Please note that replication is not supported for ACCDB format files.

    Valid. Used for numbers from –9.999... x 1027 to 9.999... x 1027. Requires 12 bytes for storage.

Advice: field size.

Format

Determines how a field appears in tables, forms, and related reports when displayed on screen or printed. Any valid number format can be used.

Indexed

Indicates whether the field is an index. There are three possible values.

    Yes (no overlap allowed). A unique index is created for the field.

    Yes (matches allowed). A non-unique index is created on the field.

    No. All indexes from the field are removed.

Note: Do not change this property for a field that is used as a primary key.

Using property Indexed It is possible to create an index on a single field, but this is not possible for all index types. For example, you cannot use this property to create an index on multiple fields.

Input mask

Allows you to display special characters to control data entry. For example, an input mask might display a dollar sign ($) at the beginning of a field.

Mandatory

Requires mandatory data entry in the field.

Smart tags

Adds a smart tag to the field. Smart tags have been deprecated since Access 2013.

Text alignment

Determines the default alignment of text in a control.

Condition on value

Allows you to enter an expression that must be true when adding or changing the value of this field. Used in combination with the Error Message property.

Error message

Allows you to enter a message to display if the value you enter does not match the expression in the Value Condition property.

Big number

Purpose. Used to store a large numeric value that is not monetary. If field values ​​can be used in calculations, select the Large Number data type.

Supported Field Properties

Property

Usage

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Short captions are most effective.

Number of decimal places

Determines the number of decimal places to display.

Default value

Automatically sets this field to the specified value when a new record is added.

Format

Determines how a field appears in tables, forms, and related reports when displayed on screen or printed. Any valid number format can be used.

Indexed

Indicates whether the field is an index. There are three possible values.

    Yes (no overlap allowed). A unique index is created for the field.

    Yes (matches allowed). A non-unique index is created on the field.

    No. All indexes from the field are removed.

Note: Do not change this property for a field that is used as a primary key.

Using property Indexed It is possible to create an index on a single field, but this is not possible for all index types. For example, you cannot use this property to create an index on multiple fields.

Input mask

Allows you to display special characters to control data entry. For example, an input mask might display a dollar sign ($) at the beginning of a field.

Mandatory

Requires mandatory data entry in the field.

Smart tags

Adds a smart tag to the field. Smart tags have been deprecated since Access 2013.

Text alignment

Determines the default alignment of text in a control.

Condition on value

Allows you to enter an expression that must be true when adding or changing the value of this field. Used in combination with the Error Message property.

Error message

Allows you to enter a message to display if the value you enter does not match the expression in the Value Condition property.

OLE object

Purpose. Used to attach an OLE object, such as a Microsoft Office Excel spreadsheet, to a record. If you are going to use OLE, you need the OLE Object data type.

In most cases, you should use an attachment field instead of an OLE object field. OLE fields support fewer file types than attachment fields. Additionally, OLE object fields do not allow multiple files to be attached to a single record.

Supported Field Properties

Text

Purpose. Used to store text up to 255 characters long. Please note that as of Access 2013, the text data type has been renamed to Short text.

Supported Field Properties

Property

Usage

Blank lines

When set to Yes, allows the entry of an empty string ("") in a text box, hyperlink field, or MEMO field.

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Short captions are most effective.

Default value

Automatically sets this field to the specified value when a new record is added.

Field size

Enter a value between 1 and 255. Text fields can contain values ​​between 1 and 255 characters. For larger text fields, use the MEMO data type.

Advice: To improve performance, always specify the minimum required Field size.

For example, if you are storing postal codes of a fixed length, you should specify it in the property Field size.

Format

Determines how a field appears in tables, forms, and related reports when displayed on screen or printed. You can define a custom format for a text field.

IME mode

Controls character conversion in East Asian versions of Windows.

IME Suggestion Mode

Controls sentence conversion in East Asian versions of Windows.

Indexed

Indicates whether the field is an index. There are three possible values.

    Yes (no overlap allowed). A unique index is created for the field.

    Yes (matches allowed). A non-unique index is created on the field.

    No. All indexes from the field are removed.

Note: Do not change this property for a field that is used as a primary key.

Using property Indexed It is possible to create an index on a single field, but this is not possible for all index types. For example, you cannot use this property to create an index on multiple fields.

Mandatory

Requires mandatory data entry in the field.

Smart tags

Adds a smart tag to the field. Smart tags have been deprecated since Access 2013.

Text alignment

Determines the default alignment of text in a control.

Unicode Compression

Compresses the text stored in this field (if less than 4096 characters are stored).

Condition on value

Allows you to enter an expression that must be true when adding or changing the value of this field. Used in combination with the Error Message property.

Error message

Allows you to enter a message to display if the value you enter does not match the expression in the Value Condition property.

Logical

Purpose. Used to store boolean values.

Supported Field Properties

Property

Usage

Signature

The signature text that appears by default for this field on forms, reports, and queries. If this property is not specified, the field name is used. Any text string is valid.

Short captions are most effective.

Default value

Automatically sets this field to the specified value when a new record is added.

Format

Determines how a field appears in tables, forms, and related reports when displayed on screen or printed. Select one of the options below.

    True/False. Displayed as True or False.

    Not really. Displayed as Yes or No.

    On Off Displayed as On or Off.

Indexed

Indicates whether the field is an index. There are three possible values.

    Yes (no overlap allowed). A unique index is created for the field.

    Yes (matches allowed). A non-unique index is created on the field.

    No. All indexes from the field are removed.

Note: Do not change this property for a field that is used as a primary key.

Using property Indexed It is possible to create an index on a single field, but this is not possible for all index types. For example, you cannot use this property to create an index on multiple fields.

Text alignment

Determines the default alignment of text in a control.

Condition on value

Allows you to enter an expression that must be true when adding or changing the value of this field. Used in combination with the Error Message property.

Error message

Allows you to enter a message to display if the value you enter does not match the expression in the Value Condition property.

OLE data entry

An OLE object field called Foto can be filled in even without the object (image) itself being displayed on the screen. The following objects can be stored in an OLE type field.

Raster images.

Sound files

Graphs and (diagrams)

Word or Excel

in such a way that they can be seen, heard or used. When you place an OLE object in a table, you will see text describing the object (for example, in an OLE type field you might see Paintbrush Picture). There are two ways to enter an object.

Paste from clipboard

Insert from the dialog box that appears after executing the Insert->Object command

MEMO data entry

The Recenzia field contains MEMO type data. This type allows you to enter up to 64,000 bytes of text for each entry. The table displays only part of the entered text. By pressing , you can display an input dialog (Zoom) with a scroll bar, which allows you to see up to 1,000 bytes of text at once

Move through records in a table

As a rule, after entering data, it often becomes necessary to make some changes. This may be due to the following reasons:

New information received

Errors detected

Need to add new entries

To change data, first open the table. In the database window, open the table in Datasheet view by double-clicking the row with its name in the list of tables. AAAAAAAAAAAAAAAAAAAAAAAA

If you are in Table Design mode, click the Views button to enter Table view to make changes to the data.

Navigate through entries

To go to any record, you can simply place the cursor on it or click on it with the mouse. But if the tables are very large, then the problem of quickly moving to the desired record becomes especially acute

You can use the vertical scroll bar to move through records. The arrow buttons on the scroll bar only allow you to move the record marker one position per click. Therefore, to move faster (through multiple records at once), it is better to use the scroll bar slider. You can also click the mouse in the area between the slider and the button on the scroll bar to move to many positions ahead.

The Edit->Go command provides several options for quickly moving around the table.

The five jump buttons located at the bottom of the window in Datasheet view can also be used to navigate through records. Clicking these buttons will allow you to jump to any record. If you know the record number (the row number for a given record), click on the record number field, enter entry number and press the key To move to the record number field, press the key .

As you move around the table, pay attention to the scroll bar prompts. Access won't update the record number field until you click on any field in the record.

Setpoint search

Although knowing the record number you can go to it and find a specific field, in most cases you will need to find a specific value in the record. This can be done in three ways:

Select the command Edit->Find (Edrt->Find)

Click on the Find Specified Text button located on the toolbar (it shows binoculars).

Use a keyboard shortcut

When using any of these methods, a dialog box will appear. To search only for a specific field, place the cursor in it (and do this before opening the dialog box). Select the Search Only Current Field check box in the dialog box and Access will search only the specified field.

This dialog box allows you to set various search parameters. In the Find What text box, enter the value you are looking for. You can enter the value as it appears in the field or by using the following special characters:

* -- Matches any number of characters

Matches one character

# -- Corresponds to one digit

To understand how these symbols work, suppose you want to find all values ​​that start with AB. To do this, enter AB*

Now let's say you want to find values ​​that end with the characters 001. In this case, enter *001. To search for any value that starts with the characters AB, ends with the characters 001, and has only two characters in between, enter AB??001. If you need to find all last names ending with “ko,” then to search for values ​​like Brodsky and Tchaikovsky, enter *ko.

The Match drop-down list contains three choices:

With any part of the field (Any Part of Field)

Whole Field

From the beginning of the field (Start of Field)

The standard option is Whole Field. For example, the value Pet will be found if the value is equal to Pet. If the Any Part of Field option is selected, the values ​​Petrov and Petrovsky will be retrieved as a result of the search. Shpetny, etc. As a result of the search with the setting Start of O, the values ​​Petrov, Petrovsky will be found.

In the Search drop-down list, you can select one or more options from the Up, Down, All set.

When you select the Search Only Current Field option button, the value will be searched in only one field. The Match Case checkbox determines whether uppercase and lowercase letters will be distinguished. By default, they do not differ. When searching for the value Pet, pet, Petr and Petrov will be found. When you select the Match Case checkbox, you must enter a search string that takes into account uppercase and lowercase letters

Obviously, for Number, Currency, and Date/Time data types, case sensitivity does not make sense.) If you select the Match Case check box, Access ignores the Search field format check box. Fields As Formatted (If you formatted the table fields, check this box) For example, you need to search the DateBirth field for records of everyone born in April 1982. To do this, check the Search Fields as Formatted option and enter Apr 92. If you do not check this box, the search will have to be performed using the exact date of birth, for example, search for 4/8/92

Using the Search Fields as Formatted checkbox can significantly slow down the search.

The search begins when you click the Find First or Find Next button. Once you find a value, Access selects it. To find the first matching value, click the Find button. To find the next value, click the Find Next button. Throughout the search process, the dialog box remains open. Therefore, once you find the value you want, click the Close button to close the dialog box

OLE Object Fields

MS Access allows you to store images and other binary data (for example, an MS Excel spreadsheet, an MS Word document, a drawing, a sound recording) in tables. The data type is used for these purposes Field object OLE. The actual amount of data that you can enter in a field of this type is determined by the size of your computer's hard drive (up to 1 Gigabyte).

Lookup wizard data type

Selecting this data type launches the Lookup Wizard, which creates a field that offers a choice of values ​​from a drop-down list containing a set of constant values ​​or values ​​from another table.

The size of this field is the same as the size of the key field used as a substitution (usually 4 bytes).

Creating a table structure

Now that we've looked at the data types in Access and the individual table field properties, we can begin creating the table structure. Let's look at creating a table structure using the example of creating a table Orders the Northwind database that comes with Access. This table already exists in the Northwind database, but reviewing the process of creating this table will be very useful. In order not to disrupt the structure of the Borei database, first create a training database and open its window.

In the table design window in the column Name fields enter Order Code .

Press the key Tab or Enter , to go to column Type data. Please note that information appears in the “Field Properties” section at the bottom of the dialog window.

In column Type data meaning appeared Text. Click on the expand list button on the right side of the rectangle and you will see a list containing all data types. From this list, use the mouse or up and down keys to select a value Counter and press the key Tab to go to column Description. Column Description represents the explanation you give for your fields. When you work with this table in the future, this description will appear at the bottom of the MS Access screen whenever you find yourself in a field Order Code , and will remind you of the purpose of this field.

Enter explanatory text in the column Description and press the key Tab or Enter , to move on to entering information about the next field.

Similarly, enter a description of all table fields.

Once you have finished entering the table structure, save it by running the command File/Save.







2024 gtavrl.ru.