Insert objects in a field with OLE data type. Placing an OLE object What is the feature of the OLE field

ACCESS 2010 has the ability to add objects in the field with OLE data type. In the case when the data type is specified as OLE (Object Linking and Embedding- binding and implementing an object), then DBMS Access saves external an objectin shared file Databases, reducing to its storage as much space, how much this object takes in the form of a separate file. Under objectsyou should understand the files created in the form of applications in graphic editors, video clips, in MS Office applications, etc. When filling out the table of data that are objects, in the appropriate field position with the OLE data type, a program is generated by which you can open this object. Displaying an object will be implemented only in forms and reports.

For embedding object In the field C. type of data OLE. You must open a table in "Designer" mode.Add a new field, for example "Photo of goods."Select data type "OLE object field", then save the table.

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

Fig. 3.38 Insert object

Fig. 3.39 Dialog box for adding a new object in the Access table

It should be remembered that there are two possibilities to embed objects in the form of data. The first opportunity provides the use of standard applications for creating a file that support Access, the second possibility of inserting an object, which allows you to use any file as a data source (Fig. 3.40).

Fig. 3.40 Add a new object in Access Table from File

1. Creating an object from the file.

When it comes to data that are objects for the database, and are external filesYou must have these files. Therefore, you will need to create multiple files in order to further see their display in the database, as well as try changing these files. For example, if you have a photo of an object in the file Monitor.jpg. (JPG - universal photo format). In order for this file to be preserved in the database, it follows in the window (Fig. 3.40) to put a mark "Create from the file" After which the window appears, which is presented in Figure 3.41. Use the button "Overview" You should select the desired file.

Fig. 3.41 File search when creating an object in the database

In the appropriate line for the field, for example, "Photo of goods" Word will appear Package (Package)This means that the file is attached to the application with which it has been created. Therefore, when viewing a database, it will be a query, form or report, the user will see a file image in the form of a icon, and when you double-click on this image, the system will first find the application, and then the contents of the file will appear in it (in this example, this is a photo) . Exceptions are image files stored with extension .bmp Bit Map Format). However, it should be reminded that the files created in microsoft applicationswill be displayed immediately in forms and reports. Conclusion Simple, photos can be inserted into applications such as Paint, Word, Power Point, maintain in the form individual filesAnd then connect in the form of an object to the database. Try to create multiple files with photos and text using various windows editors. For example, you can open document Word., insert a photo from the file, add text, and then save as: Monitor.docx(Fig. 3.42).

Fig. 3.42 Photo file created in Word

2. Creating new objects.

Under the creation of new objects in the database, you should imply the use of an application in which the file is created and then connected to the field with a description of the type of this OLE. To start the creation of new objects, you must open the table in "Table" mode, Select option "Create new" In the dialog box (Fig. 3.39), and then in the list allocate "Object type" (Application required). The list of applications that Access supports to create an object are in the list (Fig. 3.43), which will open after the command is started "Insert the object" .

Fig. 3.43 List of types of Access objects that can be used to create files

For convenience of using applications for creating objects in the form of files, it is that in the future these files can be used to autonomously or implement them in the database.

Consider object creation option for the database using with paint applications.

For example, you need to create an object with an image of an enterprise and text, which in the future user database can be replaced or fixed. To do this, select from the list bitmap Image objectThe further technology for creating an object is shown in Figure 3.44.

1. Open the PAINT application

2. Insert photos from the file.

3. Add text (if necessary).

4. Save how the file.

5. Close the application.

Fig. 3.44 TECHNOLOGY OF THE OBJECT IN PAINT

The task 3.11

1. In the table " Products"In mode "Constructor" Add a new column named "Photo of goods", data type " Field OLE object », Save the changes.

2. In mode "Table" in field "Photo of goods" Choose a string "Insert an object from the file", Select (Point) "Create new" and from the drop-down list indicate document Microsoft Word. . At the same time will open text editor MS Word.Here it is necessary to insert the drawing corresponding to the product in this line. Pictures Select from the list that is stored directly in the editor ("Insert tab", "Picture" icon, in the start dialog box on the start button), or insert the drawing from other programs. You can use the PAINT application (Bitmap Image object), where you draw the goods yourself. Created file Close, it will automatically be tied to your database, to the string in which it inserted.

3. Do this procedure for all rows you tables "Goods".

4. Save the changes.

Control questions

1. What objects can be pasted into the database with OLE data type?

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

3. Where in the database photography will be displayed?

4. What is the difference between the method "Create a new object" from the "Create File" method?

5. How to place the file of the product photos in the database if it has an extension .png.?

6. Is it possible to carry out the edit of the file that is inserted as an object in the database directly in file System Computer?

7. How to insert a presentation to the database?

8. What applications can be inserted into the database?

ACCESS 2010 has the ability to add objects in the field with OLE data type. In the case when the data type is specified as OLE (Object Linking and Embedding- binding and implementing an object), then DBMS Access saves external an objectin the overall database file, removing so much space to storage as this object is in the form of a separate file. Under objectsyou should understand the files created in the form of applications in graphic editors, video clips, in MS Office applications, etc. When filling out the table of data that are objects, in the appropriate field position with the OLE data type, a program is generated by which you can open this object. Displaying an object will be implemented only in forms and reports.

For embedding object In the field C. type of data OLE. You must open a table in "Designer" mode.Add a new field, for example "Photo of goods."Select data type "OLE object field", then save the table.

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

Fig. 3.38 Insert object

Fig. 3.39 Dialog box for adding a new object in the Access table

It should be remembered that there are two possibilities to embed objects in the form of data. The first opportunity provides the use of standard applications for creating a file that support Access, the second possibility of inserting an object, which allows you to use any file as a data source (Fig. 3.40).

Fig. 3.40 Add a new object in Access Table from File

1. Creating an object from the file.

When it comes to data that is the objects for the database, and are external files, you must have these files. Therefore, you will need to create multiple files in order to further see their display in the database, as well as try changing these files. For example, if you have a photo of an object in the file Monitor.jpg. (JPG - universal photo format). In order for this file to be preserved in the database, it follows in the window (Fig. 3.40) to put a mark "Create from the file" After which the window appears, which is presented in Figure 3.41. Use the button "Overview" You should select the desired file.

Fig. 3.41 File search when creating an object in the database

In the appropriate line for the field, for example, "Photo of goods" Word will appear Package (Package)This means that the file is attached to the application with which it has been created. Therefore, when viewing a database, it will be a query, form or report, the user will see a file image in the form of a icon, and when you double-click on this image, the system will first find the application, and then the contents of the file will appear in it (in this example, this is a photo) . Exceptions are image files stored with extension .bmp Bit Map Format). At the same time, it should be reminded that the files created in Microsoft applications will be displayed immediately in forms and reports. Conclusion Simple, photos can be inserted into applications such as Paint, Word, Power Point, save in the form of individual files, and then connect as an object to the database. Try to create multiple files with photos and text using different Windows editors. For example, you can open the Word document, insert a photo from the file, add text, and then save as: Monitor.docx(Fig. 3.42).

Fig. 3.42 Photo file created in Word

2. Creating new objects.

Under the creation of new objects in the database, you should imply the use of an application in which the file is created and then connected to the field with a description of the type of this OLE. To start the creation of new objects, you must open the table in "Table" mode, Select option "Create new" In the dialog box (Fig. 3.39), and then in the list allocate "Object type" (Application required). The list of applications that Access supports to create an object are in the list (Fig. 3.43), which will open after the command is started "Insert the object" .

Fig. 3.43 List of types of Access objects that can be used to create files

For convenience of using applications for creating objects in the form of files, it is that in the future these files can be used to autonomously or implement them in the database.

Consider object creation option for the database using with paint applications.

For example, you need to create an object with an image of an enterprise and text, which in the future user database can be replaced or fixed. To do this, select from the list bitmap Image objectThe further technology for creating an object is shown in Figure 3.44.

1. Open the PAINT application

2. Insert photos from the file.

3. Add text (if necessary).

4. Save how the file.

5. Close the application.

Fig. 3.44 TECHNOLOGY OF THE OBJECT IN PAINT

The task 3.11

1. In the table " Products"In mode "Constructor" Add a new column named "Photo of goods", data type " Field OLE object », Save the changes.

2. In mode "Table" in field "Photo of goods" Choose a string "Insert an object from the file", Select (Point) "Create new" and from the drop-down list indicate microsoft document Word.. This opens text editor MS Word.Here it is necessary to insert the drawing corresponding to the product in this line. Pictures Select from the list that is stored directly in the editor ("Insert tab", "Picture" icon, in the start dialog box on the start button), or insert the drawing from other programs. You can use the PAINT application (Bitmap Image object), where you draw the goods yourself. Created file Close, it will automatically be tied to your database, to the string in which it inserted.

3. Do this procedure for all rows you tables "Goods".

4. Save the changes.

Control questions

1. What objects can be pasted into the database with OLE data type?

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

3. Where in the database photography will be displayed?

4. What is the difference between the method "Create a new object" from the "Create File" method?

5. How to place the file of the product photos in the database if it has an extension .png.?

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

7. How to insert a presentation to the database?

8. What applications can be inserted into the database?

Using data type OLE field (OLE OBJECT)

The OLE field is a means to establish communication with the objects of another application or implement an object in the database. Objects can be texts simple and formatted, drawings, diagrams, sound recording files (.wav), MIDI music (musically instrumental digital interface), animation files (.fli ,.mmm), video clips (.avi), spreadsheets From other applications that support this tool. Software application Access, Supporting OLE, fully integrates with other package applications Microsoft. Office. .

Implanted object Stored in the database file and is always available. A double-click of a cell containing an embedded object, the ability to edit an object by means of an application in which the object was created.

Related object Saved in the object file. The object file can be updated independently of the database. Last changes Will be displayed at the next opening of the table. When working with the database, you can also view and edit the object. To display the OLE object in the form or report, you need to create an attached object of the object.

For example, in the Frequency Table lemm add the Sound field, which should contain a recording of the pronunciation of the word lemma in format (.wav). If you have on your disk sound files With the pronunciation of individual words from the table frequency_lum, you can connect each such sound file with the field sound field. To do this, open the frequency_lum table and sort it up on the lemma field in the increasing order (click the arrow near the lemma field name and then select sorting from A to Z). Sorting is made for the convenience of finding the desired word. Then choose the word for which there is a sound file, for example "Grandma". Next, you should put the cursor on the Sound Recording Speed \u200b\u200bfrom the lemma \u003d grandmother and click the right mouse button. The drop-down menu will open, in which you want to select the insert object item. A window will open in which you want to click the Create button from the file and then select the audio file on the disk with the pronunciation of the word "grandmother". In the Sound field will appear inscription Package. Now if you press this inscription twice, the sound file playback will be called (as a rule, this is a player. Windows Media) and the word "grandmother" will sound. The same actions should be performed with all the words for which there are sound files. As a result of the task word operation, for which their sound can be heard, will be marked accordingly (Fig. 14.9).

Fig. 14.9.

Using the type of hyperlink

Special data type hyperlink (eng. Hyperlink. ) Allows you to store hyperlinks in the database table fields Access. The fields with the type of hyperlink are used to go to objects of the same or other database. Access, to documents created in various applications Microsoft. Office and located on local or network disks, Web server pages and other resources on the Internet. When you click on the hyperlink, the transition to the document that opens by the application created by its application is performed.

To attach hyperlink to data database, you need to perform the following sequence of actions. We will add a frequency of the lemma field to the table, which will contain hyperlinks for dictionary articles on the Internet with definitions for this lexeme.

In the constructor mode, set the type of this field \u003d hyperlink.

We will search on the Internet the values \u200b\u200bof obsolete and not quite understandable to the modern reader of words from a fairy tale, for example, "Horses", "Boyar", "Kochetok".

For the first speech ("GORNOROVET") on the Internet managed to find only a drawing with the image of the details of the manual mill, among which there are two small millstones, suppose that this is "Herrowrs" (Club- kaup.narod.ru/rec/arcussr/Tablell2 .jpg). The word "travelers" is formed as a diminutive from the word of the reel according to the tradition of Russian word formation. For the second word - "boyar" there is a vocabulary article in Wiktionary (RU.wiktionary.org/wiki/Boyarin). The third word, kochetok, found on the "Dictionaries and Encyclopedia Academician" website in the electronic version of the Ushakov Dictionary (dic.academic.ru/dic.nsf/ushakov/842550).

Each found link must be copied in the field of the Frequetable Table field. Subsequently, when you click on the link in this field, the Internet browser program is launched, which will open the appropriate web page in separate window browser. The view of the Access database table with inserted hyperlinks is shown in Fig. 14.10.

Logical format

Money format

Numeric format

Text format

Data types

The size text field May be in the range from 1 to 255 characters.

The type of numeric field can take values \u200b\u200bfrom the following list:

byte- integers ranging from 0 to 4 255;

whole- integers from - 32768 to 32767;

longwhole - 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.

Format "Date / Time"

For data type Date Timethere is a set of field formats below with examples:

Full format (installed by default) 15.04.94 05:30:10 PM

Short date format 15.04.94

Long time format 17:30:10

Middle time format 05:30 PM

Brief format of time 17:30

By default, the cash format is the numbers recorded with two decimal places, with separation of groups of discharges and designation "R."in the end. The user can record in the string Field formattemplate for your format. Suppose it is necessary to introduce amounts in dollars. Then you need to install the cursor for word Monetaryand replace it with a pattern of format, for example, such: # ###$ .

Format "Counter"

Fields type "Counter" perform certain function - Automatic identification of table entries. Therefore, the properties that could be changed, a bit of such a field. First, the meter is always the number. Secondly, the extension of its value occurs automatically. Access offers two options for changing the meter: consistentand random.The first option is convenient because it allows you to numbered records. The second option can be used if you need to create a record encoding system in a table, protected from careless operations of the operator.

The cell in the logical type field can contain only one of two values: Yesor Not.Access offers two more logical type names: Truth / Lieand Enabled / off.Regardless which field format you select, the logical field will be presented in the table as a set of flags. When you click the mouse checkbox, it leads to the fact that the box appears in the square, which corresponds to the logical value. Yes. Reset flag means assigning a logic field to a cell Not.Using logic fields may be different, for example, in questionnaires or to create controls.

Field of Ole object(Object Linking and Embedding) - the latest field type selected from the list. It has only two properties: signature and parameter "Required field". Field 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 implement an OLE-object field into the cell, you need to install the cursor and by pressing the right mouse button, call context menu. In it, select the command Insert an object. The program will reveal the dialog box to select the object type. Object B. this case It is identified with the application in which it can be created or edited.

Second Object Insertion - Select Switch Create from file. in the window Insert object.INthis case is meant that the file already exists, and you need to establish a connection with it. Access will open the window opening window and after selecting the right file Determine what application must be opened to work with it.

Table Department Provided PHOTO, Which should contain a photo of the head, stored in the format of the Paint graphics editor in the file with the extension * .bmp. The type of data of this field must be defined as OLE object field. The implementation of this object in the field is made at the stage of filling in the table fields.

Table 2. Description of the properties of the field of the Department Table

Table 3. DESCRIPTION OF THE PROPERTIES OF POLETIBILITY REPRATORER

Use of data type - Memo field

Table THING Provided the field Progwhich will contain the text of the long length - the course program. For such a field, data type is selected - Field Memo . Entering data into this field can be performed directly in table mode or form.

Field of Ole object And when entering the values \u200b\u200bto establish communication with files where the texts are stored.

Table 4. Description Table properties

Field name Index-sized Required field Data type The size Signature field Condition to value Error message
KP Yes, the owl. No tolerance. Yes Text Object Code
NP. Yes Text Name of the subject
CLOCK Not Numerical Whole Total hours \u003e 0 and.<=300 Error. number of hours
League Not Numerical Whole Lectures
ETC Not Numerical Whole Practice
Emergency Not Numerical Whole Semestrs
Prog Not Memo field Program

Definition of a composite primary key

Table STUDENT In a composite primary (indexed) key Fields include Ng and ns. To determine this key in the table constructor mode, you must select both of these fields, clicking the mouse button on the marking area when the key is pressed . Then press the toolbar button Key field. Similarly, the composite keys in the tables are determined. Study and academic performance.



Table 5. Description of the properties of the tablestore fields

Create a table structure Study, academic performance. When creating tables, use their properties that are presented in Tables 6, 7.

Table 6. Description of the properties of the table

Field name Indexed, field Required field Data type The size Signature field
NG Yes Text Group number
KP Yes Text Item code.
Tabn Yes Text Tab. Room prep.
VIZ Yes Text Type of occupation
CLOCK Not Numerical Whole Clock

Table 7. Description Table properties performance

Field name Indexed Required field Data type The size Signature field
NG Yes, coincidences are allowed for each field Yes Text Group number
Ns. Yes Text Student number
KP Yes Text Object Code
Tabn Yes Text Tab. nom. teacher
VIZ Yes Text Type of occupation
Evaluation Not Numerical Whole Evaluation

Task N 3.

Entering data in database tables



After determining the structure of the table, you can proceed to the second stage of creating a table - data entry. To execute the task, follow these steps:

1. Launch Access.

2. Load your database that you created when executing the second job.

3. Enter entries in table mode:

We introduce several entries in the table Department. For this database vne, select the table to the box and click Open.

Fill in the lines (entries) of the table of the table in accordance with the names of columns (fields), which is presented in Table 8.

Table 8. Writing tablesAndra

When you enter, the data is automatically checked for compliance with the specified type of field, size and condition for the value. The uniqueness of the key fields is monitored.

The transition from one field to another can be performed by key . Cancel input value in the field -<ESC\u003e, cancel entering the entire record, you can double-click .

Placing an OLE object

Consider the placement of the facility Ole.on the example of the field of the head of the Department of Head of the Department in the table Department. Let the photos are stored in a graphic editor format Paint.(in extension files *. bMP on disk C).

We set the cursor to the appropriate table field. Perform a command Insert - object. In the window Insert object it should be noted Create from the file. Window Insert object Converted to a format that allows you to enter a file name with a photo. You can see the contents of the field through the form, report or graphics editor Paintclicking twice on the type field Ole. with content. Further file changes will not be reflected in the built-in object. After entering the cell, the type of object will be specified. - Point Figure NMR.

Using the data given in Table. From 9 to 14, enter the records in the table of the student, teacher, group, learning, subject and academic performance.

Table 9. Table data student

Table 10. Table data Lecturer

Tab. number FULL NAME. Uch Tsevia Department Code
Andreev A. P. Dr. tech. Science Professor
Apukhtin I.S. Cand. tehn.nak Assistant professor
Glukhov I.L. Cand. tehn.nak Assistant professor
Sechenov Yu.B. Cand. tehn Science Assistant professor
Chernov l, k. Cand. tehn.nak Assistant professor
Blumikina I.P. Dr. Fiz-Mat.Nehuk Professor
Lviv P.R. Assistant
Shaposhnikov S. I. Dr. tech. Science Professor
Novikov P.N. Assistant
Ilyasov I.T. Cand. Phil. Science Assistant professor
Pustunseva.P. Cand. East. Science Assistant professor

Table 11. Table data Group

Table 12. Table Study Table

Group number Object Code Tab. Room teacher. Type of occupation CLOCK
League
Etc
League
Etc
League
Etc

Table 13. Data Table Accountability

Group number Student number Object Code Tab. Room teacher. Type of occupation Evaluation
League
Etc
League
Etc

Table 14. Table data

Pre-meta code Name of the subject Total hours Lectures Praktika Semes Program
Computer science
Mathematics
History

Entering data in the field PROGRAM (Field type Memo ) You can perform directly in the table or via the input area called by pressing the keys. +.

If the texts of the programs are already prepared in some text editor, for example, Microsoft Word, and stored in separate files, convenient for this field to set the type Field of Ole object And when entering the values \u200b\u200bto establish communication with files. Independently enter the topics studied for each subject.

Technology for creating a data schema on the Database Example Curriculum