OLE (Object Linking and Embedding) - Databases: basic concepts. Arbitrary length text fields What is an ole object field

OLE object fields

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

Lookup master data type

Selecting this data type launches a lookup wizard that 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).

Create a table structure

After we have looked at the data types in Access and the individual properties of the table fields, we can begin to create the structure of the table. 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 is already in the Northwind database, but it will be very useful to review the process of creating this table. In order not to break the structure of the Northwind database, first create a sample database and open its window.

In the table design window in the column Name fields enter OrderCode .

Press key Tab or Enter , to go to column Type of data. At the same time, note that information appears in the "Field Properties" section at the bottom of the dialog box.

In column Type of data value appeared Text. Click on the expand 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 use the up and down keys to select a value. Counter and press the key Tab to move to a column Description. Column Description represents the explanation you give to 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 are in the field. OrderCode , and remind you of the purpose of this field.

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

Enter a description for all fields in the table in the same way.

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

OLE (Object Linking and Embedding)

OLE (Object Linking and Embedding) is a protocol for linking and embedding objects. Allows you to insert into a document or object of one application (OLE client) objects (OLE objects) of other applications that support the OLE protocol (OLE servers). In Access, OLE objects can be inserted, for example, into a field, form, or report.

OLE (Object Linking and Embedding) is a protocol for linking and embedding objects. Allows you to use data in various formats in forms and reports - for example, graphics or documents created in other programs.

OLE (eng. Object Linking and Embedding, pronounced oh-lay [olei]) is a technology for linking and embedding objects into other documents and objects developed by Microsoft.
OLE allows you to transfer part of the work from one editing program to another and return the results back. For example, a publishing system installed on a personal computer can send some text for processing to a text editor, or some image to an image editor using OLE technology.
The main advantage of using OLE (other than reducing the file size) is that it allows you to create a master file, a file of functions that the program accesses. This file can operate on data from the source program, which, after processing, is returned to the source document.
OLE is used in the processing of compound documents (eng. compound documents), can be used when transferring data between different unrelated systems through a transfer interface (eng. drag-and-drop), as well as when performing operations with the clipboard. The idea of ​​embedding is widely used when working with multimedia content on web pages (for example, Web TV), which uses the transmission of images, sound, video, animation in HTML pages (hypertext markup language) or in other files that also use text markup (for example, , XML and SGML). However, OLE technology uses a "thick client" architecture, that is, a network PC with redundant computing resources. This means that the type of file or program being tried to inject must be present on the client's machine. For example, if OLE operates on Microsoft Excel spreadsheets, then Excel must be installed on the user's machine.

OLE 1.*
OLE 1.0 was released in 1990 based on the DDE (Dynamic Data Exchange) technology used in earlier versions of the Microsoft Windows operating system. While DDE technology was severely limited in the amount and methods of transferring data between two running programs, OLE was able to operate on active connections between two documents, or even embed a document of one type within a document of another type.
OLE servers and clients interact with system libraries using virtual function tables (VTBL). These tables contain pointers to functions that the system library can use to interact with the server or client. The OLESVR.DLL (on the server) and OLECLI.DLL (on the client) libraries were originally designed to communicate with each other using the WM_DDE_EXECUTE message provided by the operating system.
OLE 1.1 later evolved into the COM (component object model) architecture for working with software components. Later, the COM architecture was transformed and became known as DCOM.
When an OLE object is placed on the clipboard, it is saved in native Windows formats (such as bitmap or metafile) and also saved in its native format. The native format allows an OLE-enabled program to embed a chunk of another document copied to the clipboard and store it in the user's document.

OLE 2.0
The next evolutionary step was OLE 2.0, which retained the same goals and objectives as the previous version. But OLE 2.0 was built on top of the COM architecture instead of using VTBL. New features include automation of drag-and-drop technology, in-place activation and structured storage.

Keywords: access 2010 database; db access; subd access; access databases; access example; access programming; ready database; creating a database; DBMS database; access coursework; database example; access program; access description; access abstract; access requests; access examples; download database access; access objects; db in access; download subd access; ms access 2003 database; subd access abstract; subd ms access; access benefits; database; download database on access; Database; relational database; database management systems; course database; download database; access database download; access database download; abstract database; creation of a DBMS; download passport database; database; data normalization; DBMS examples; database examples; term papers on DBMS; normalization; database; database structure; database example; query base; training database; database design; data; description of the database; subd abstract; create a database; database for; database usage; course work database; finished; use of a DBMS; database table; database 2008 download; base

Boolean format

Money format

Numeric format

Text format

Data types

The size of the text field can range from 1 to 255 characters.

The type of a numeric field can take values ​​from the following list:

byte- integers ranging from 0 to 4255;

whole- integers from - 32768 to 32767;

long integer - integers from - 2147483648 to 2147483647;

floating point (4 bytes)- numbers ranging from - 3.402823E38 to 3.402823E38;

floating point (8 bytes) - numbers ranging from minus 1.79769313486232E308 to plus 1.79769313486232E308.

Date/Time Format

For data type Date Time There is a set of field formats shown below along with examples:

Full format (set by default) 04/15/94 05:30:10 PM

Short date format 04/15/94

Long time format 17:30:10

Medium Time Format 05:30 PM

Short time format 17:30

By default, the currency format represents numbers written with two decimal places, with separation of groups of digits and the notation "R." in the end. The user can write in a line Field Format template for your format. Let's say you want to enter dollar amounts. Then you need to place the cursor on the word Monetary and replace it with a format pattern like this: # ###$ .

Format "counter"

Fields of the "counter" type perform a specific function - automatic identification of table records. Therefore, there are few properties that could be changed for such a field. First, the counter is always a number. Secondly, its value is incremented automatically. Access offers two options for changing the counter: consistent and random. The first option is convenient because it allows you to number the records. The second option can be used if you need to create a system for encoding records in a table that is protected from careless actions of the operator.

A cell in a boolean field can only contain one of two values: Yes or No. Access offers two more options for boolean type names: True/False and Enabled/Disabled. Regardless of which field format you choose, a logical field will be represented in the table as a set of checkboxes. When you click on a checkbox with the mouse, it causes a checkmark image to appear in the square, which corresponds to a boolean value Yes. Resetting a checkbox means assigning a boolean value to a cell No. The use of logical fields can be different, for example, in questionnaires or to create controls.

OLE object field(Object Linking and Embedding) - the last field type selected from the list. It has only two properties: a caption and a "required field" parameter. Fields of this type do not store information as such, but contain references to objects that can be included in the database using the OLE data exchange protocol. Such objects can be, for example, graphic files.



In order to embed an OLE object into a field cell, you need to place the cursor on it and, by pressing the right mouse button, call the context menu. In it, select the command Insert object. The program will open a dialog box to select the object type. The object in this case is identified with the application in which it can be created or edited.

The second option for inserting an object - selecting a radio button Create from file in the window Inserting an object. AT In this case, it is assumed that the file already exists, and you need to link to it. Access will open a window for opening a document, and after selecting the desired file, it will determine which application must be opened to work with it.

OLE object field(Object Linking and Embedding) - the last field type selected from the list. It has only two properties: a caption and a "required field" parameter. Fields of this type do not store information as such, but contain references to objects that can be included in the database using the OLE data exchange protocol. Such objects can be, for example, graphic files. Even the best DBMS is not able to provide storage of all types of information representation that exist today. Yes, this is not necessary. It is enough to communicate with an application that works with one or another type of file. That's what the OLE protocol is for.

In order to embed an OLE object into a field cell, you need to place the cursor on it and, by pressing the right mouse button, call the context menu. In it, select the command Insert object. The program will open a dialog box to select the object type. The object in this case is identified with the application in which it can be created or edited. In the case when the switch is set in this window Create new, the corresponding application opens, which is slightly different from the usual one. Thus, the user does not have the ability to open an existing file in order to make it an object. For example, if a Word document is selected and the finished document is already on disk, then you will have to open it in the editor separately, copy it to the clipboard, and then go to the document window associated with Access and paste the contents of the clipboard. If the object is created, as they say, "from scratch", then work in the selected application occurs in the usual way. The command to exit the application is also modified. In this case, it is no longer possible to close the application and end up in Windows, but you can only return to Access.

The second option for inserting an object - selecting a radio button Create from file in the window Inserting an object. In this case, it is assumed that the file already exists, and you need to link to it. Access will open a window for opening a document, and after selecting the desired file, it will determine which application must be opened to work with it. Keep in mind that more than one application can correspond to the same file type. For example, files with the BMP extension are used by various graphic editors. The application selected by Access is launched and the file selected by the user is opened in it. Object injection ends when you close the program.

Entering and editing data in the "Table" mode

The DBMS enters the Table mode when the button is pressed. The table window uses special characters to display the new and currently edited record.


Fig.5. Table window in Table view

Each table contains an empty entry that follows the last existing entry and is for new data entry. To enter, place the cursor in the table field and type data on the keyboard. To move to the next field use the TAB key, to the previous field - SHIFT+TAB. The record is automatically saved when switching to another record (the record marker along the left border of the table changes shape: a triangle appears instead of a pencil), that is, no special saving of data in the table is required. To switch between records, you can use the on-screen buttons at the bottom of the table window (to the first, next, last record).

Some fields cannot be changed: these are "Counters", calculated fields and fields locked by another user when collaborating with one table. If the database was opened in read-only mode, then data entry is also not available.

data editing includes the following basic operations: replacing data values, deleting records, adding records. To correct data in the "Table" mode, "manual" methods are used: the mouse cursor is brought to the place to be changed in the table, a fragment is selected (a separate field, record or column) and new data is entered, data is inserted from the buffer or data is deleted using the DELETE key.

Ways to select fragments:

Field highlighted with a double click,

Recording(line) is selected by clicking on the empty gray cell near the left border of the window,

Column highlighted by clicking on the column heading,

Rectangular fragment: select a field in one corner, press the SHIFT key and, without releasing, select a field in the opposite corner (or by dragging the mouse).

Whole table is selected by clicking on the gray rectangle in the upper left corner of the table.

To copy data from one table to another (or to the same table) the Windows buffer is used:

Select the required data in one table;

· click the "Copy" button on the toolbar;

go to the destination field (by pointing to it with the mouse or by hovering the cursor with the TAB keys),

· Click the "Insert" button on the toolbar.

The PHOTO field is provided in the DEPARTMENT table, which should contain a photo of the head, stored in the Paint graphic editor format in a file with the .gif extension. The data type of such a field must be defined as OLE Object Field. This object is placed in the field at the stage of filling in the table fields. An object can be embedded or linked.

COMMENT

OLE (Object Linking and Embedding) is a method of transferring information in the form of objects between Windows applications. An OLE object field is a tool that allows you to communicate with objects in another application or embed an object in a database. Objects can be simple and formatted texts, pictures, diagrams, audio files (.WAV), music in MIDI format (Musical Instrument Digital Interface), animation files (.FLI, .MMM), video clips (.AVI), spreadsheets from other applications that support this tool. Access, supporting OLE, is fully integrated with other applications of the Microsoft Office suite.

The embedded object is stored in the database file and is always available. By double-clicking on a cell containing an embedded object, you can edit the object using the application in which the object was created.

The associated object is stored in the object file. The object file can be updated independently of the database. The latest changes will be displayed the next time you open the form or report. When working with a database, you can also view and edit an object.

The edited linked object will be saved in the object file and not in the database file. Object linking is useful when working with large objects that you don't want to include in a database file, or with objects that are used in multiple forms and reports. If the linked object file is moved, you must re-link.

COMMENT

To display an OLE object in a form or report, you need to create an “Object Attached Frame” control (see Chapters 4, 6).

Using the Memo Field Data Type

The SUBJECT table provides for the PROG field, which will contain a text data of great length - a short program of the course. For such a field, the data type is selected - Field MEMO (Memo). Entering data in this field can be done directly in the table, or through the input area, called by pressing the + keys.

If the texts of programs on subjects are prepared in some text editor, for example, Microsoft Word, and are stored in separate files, it is convenient for this field to set the OLE Object field type (OLE Object) and, when entering values ​​into it, establish a connection with files.



Fields of type Hyperlink are used to navigate to objects in the same or another Access database, to documents created in various Microsoft Office applications and located on local or network drives, to Web server pages and documents from other resources on the network Internet or intranet. Clicking on a hyperlink navigates to the document that is opened by the application that created it. The creation of hyperlinks in tables, forms and reports will be discussed in detail below. The creation of a hyperlink in the field of the TEACHER table is also considered there.

Defining a Composite Primary Key

In the STUDENT table, the composite primary (unique) key includes the NC and NC fields. To determine this in table design mode, select both of these fields by clicking the mouse button on the marking area while holding down the key. Then press the Primary Key toolbar button.

Similarly, composite keys are defined in the STUDY PROGRESS tables.

An exercise

Create the structure of the STUDY, PROGRESS tables. When creating tables, use the options provided in Appendix A.

Table A.1. Description of field properties of the STUDENT table

Field name key field Unique field Required field Data type The size Number of decimal places Field label
NG Yes Yes Text Group
NS Yes Yes Text Student number in the group
Full name Yes Text Full name
GODR Not Numerical Whole Year of birth
ADDRESS Not Text
PBALL Not Numerical With floating dot 4 bytes Passing score


Table A.2. Description of the field properties of the GROUP table

Table A.3. Description of the properties of the fields of the DEPARTMENT table

Field name key field Unique field Required field Data type The size Number of decimal places Field label
CCAF Yes Yes Yes Text The code
NCAF Not Text Name
TEL Not Text
HEAD Not Text Full name cafe
A PHOTO Not OLE object field Manager's photo

Table A.4. Description of the properties of the fields of the TEACHER table

Field name key field Unique field Required field Data type The size Field label
TABN Yes Yes Yes Text Tab. room
Full name Yes Text Name of teacher
ST Not Text Uch. degree
SW Not Text Uch. rank
CCAF Yes Text Department code

Table A.5. Description of the properties of the fields of the SUBJECT table

Field name key field Unique field Required field Data type The size Field label Value condition Error message
KP Yes Yes Yes Text Item Code
NP Not Text Item name
WATCH Not Numerical Whole Total hours >0 And<=300 The number of hours must not exceed 300
LEK Not Numerical Whole Lectures
ETC Not Numerical Whole Practice
emergency Not Numerical Whole Semester
PROG MEMO field Program

Table A.6. Description of the properties of the fields of the STUDY table

Field name key field Unique field Required field Data type The size Number of decimal places Field label
NG Yes Yes Text Nom. groups
KP Yes Yes Text The code. subject
TABN Yes Yes Text Tab. n. teacher
VIDZ Yes Yes Text Type of occupation
WATCH Not Numerical Whole Wed subject score
SBALL. GR Not Numerical From sq. dot 4 bytes

Table A.7. Description of the properties of the fields of the PROGRESS table

Field name key field Unique field Required field Data type The size Number of decimal places Field label
NG Yes Yes Text Group number
NS Yes Yes Text Nom. student
KP Yes Yes Text Item Code
TABN Yes Yes Text Tab. n. teacher
VIDZ Yes Yes Text Class type
GRADE Not Numerical Whole

Entering data into database tables