How to set up smartphones and PCs. Informational portal
  • home
  • Windows 7, XP
  • Topics of term papers on discipline "Databases": References. Certificate from PND for the sale of an apartment

Topics of term papers on discipline "Databases": References. Certificate from PND for the sale of an apartment

REPORT

Database maintenance program.

Module Project1 contains information about all 2-Forms.

Form 1 ( Unit1) - contains the main menu, which has the following items:

  1. Data
  2. References

Ø Reference1

  1. Report

Ø Sales report

Ø Income report

  1. Exit

To create a menu on the form, install the component main menu , which has following properties:

Ø AutoHotkeys– whether keys will be created automatically shortcut. If choose maAutomatic, then Delphi will automatically generate the keys. At manual this is done manually.

Ø AutoMegre– automatic merging with child windows.

Ø Images– connecting a list of pictures that can be displayed on menu items.

Ø Items- describes the menu items.

To edit the menu, double-click on the Items property and the menu editor will open. The same editor can be called by double-clicking on the component MainMenu1. In the object inspector, type in the property Caption the word "Data". By pressing the Enter button, the "Data" menu will be created. The rest of the menu items are created in the same way.

Creating a sub-item for the "Report" menu. Click in the frame just below the "Report" menu, and in the property Caption we enter the word "Report on the sale of goods." The rest of the menu sub-items are created by analogy.

To create a menu item click event handler, select the menu item " Exit» and double-click on it, or go to the Events tab and double-click on the event onclick. These actions will cause Delphi to create a menu click event handler. In this handler, write the following:

Here we are using the form method close . this method closes the form. If we close the main form, the entire application will close.

For the "Data" menu item, we assign an event handler:

GroupBox1.Visible:=True;

This method makes visible the GroupBox1 object and the objects located on it, which are used to enter and edit data in the tables: "Product", "Incoming goods", "Sale of goods".

The database connection to the program is organized through the following components:

Ø Table1:TTable;

Ø DataSource1:TDataSource;

Ø DBGrid1:TDBGrid.

Let's place an object DBGrid1 from the component palette DataControl Form1. Activate this object by selecting it with the mouse. Let's go to its property data source datasource1.

Place a non-visual object DataSource1 from the component palette Data Access on the Form1. Activate this object. Let's go to its property dataset and select them from the dropdown list Table1.



Let's select a non-visual Table1:TTable from the BDE component group. Let's put it anywhere Form1. Activate this object by selecting it with the mouse. Let's go to its property table name. From the drop-down list, select the table "Product". Let's go to the property active. Let's make it equal True. After that in dbgrid the selected table will be displayed.

To manage this table (adding, deleting records, saving or canceling changes) put on Form1 below the table is a DBNavigator object. To do this, select it in the components palette datacontrols. Activate it and go to the property data source, choose from the drop-down list DataSource1.

By analogy, we create the remaining 2 tables for the tables " postup" and " Rashod».

To create an inscription above the table, we place an object on our form data source from the component palette Standard. Let's activate it. Let's go to its property caption. Enter the text "Product".

By analogy, inscriptions are created for other tables: “ postup" and " Rashod».

To create a button with a picture, go to the group of components additional. Let's choose an object BitBtn. Let's place it on an object GroupBox1. Let's activate it. Let's go to its property kind. From the drop down list select bkCancel. Next, let's move on to the property. Caption. Let's write the word "Exit". Let's get on the property kind and make it equal bkCustom. Create an event handler for this button:

GroupBox1.Visible:=False;

To create a wildcard field, you need to activate the object Table2. Double click on this object. The field editor window will open. In the field editor context window, select the command NewFields. Let's give the new field the name "tov" and the type String. Set the radio button in the group field type into position lookup. Listed dataset Table1 This is the dataset that needs to be viewed. On both lists KeyFields and LookupFields this dialog box, select the value code- this is the general field, by the value of which the search will be performed. Listed result choose the value NaimT– this is what needs to be displayed in our dataset.

Similarly, we create substitution fields for table Table3.

For the submenu item “Sales Report” and “Receipt Report”, we will create an event handler with a change in the names of tables and fields, respectively, which unloads table data into a document Microsoft Word:

Var Str1,Str2,Str3,Str4:String;(announces type variables String }

VSpisok,mark:Variant;(declares variables of type Variant }

VSpisok:=CreateOleObject("Word.Application.8");(Creates an Ole object)

VSpisok.Documents.Open("D:\institut\Nort\spisok0.doc");(loads document template)

VSpisok.ActiveDocument.SaveAs("D:\institut\Nort\spisok1.doc");(saves template to working document)

VSpisok.Visible:=True;(makes a window Word visible}

mark:=VSpisok.ActiveDocument.Bookmarks;(into a variable mark writes a bookmark)

mark.Item("N1").Select;(places cursor on bookmark N1)

Table3.First;(sets to the first record of the table)

While Not Table3.Eof do begin(fills the table in a loop)

Str1:=Table3["KodR"];(sets Str1 to the value of the Table3 field)

Str2:=Table3["product"];(sets Str2 to the value of the Table3 field)

Str3:=FloatToStr(Table3["kol"]);(converts the value of the Table3[‘kol’] field from the Number type to the String type and assigns given value variable Str3 )

Str4:=DateToStr(Table3["DataR"]);(converts the value of the Table3[‘DataR’] field from the Date type to the String type and assigns this value to the Str4 variable)

VSpisok.Selection.InsertBefore(Str1);(write Str1 to current position)

VSpisok.Selection.InsertBefore(Str2);(write Str2 to current position)

VSpisok.Selection.MoveRight(12);(move to the next field of the document table)

VSpisok.Selection.InsertBefore(Str3);(write Str3 to current position)

VSpisok.Selection.MoveRight(12);(move to the next field of the document table)

VSpisok.Selection.InsertBefore(Str4);(write Str4 to current position)

VSpisok.Selection.MoveRight(12);(move to the next field of the document table)

Table3.Next;

For the "Help 1" submenu, let's create an event handler:

Form2.ShowModal;

Method ShowModal opens Form2 (on top of all other windows).

This Form is designed to display data on the sale and receipt of goods. The choice of goods is carried out double click by recording the required product in the "Product" table.

To create this form you must perform the following sequence in the main menu Delphi File - New - Form. Save it to the directory where our database is saved. In plug-ins uses, in the code editor, write Unit1.

Now let's create a table where the information for the sample will be taken from. To do this, choose an object DBGrid1 from the component palette DataControls and object DataSource1 from the component palette Data Access. Let's place these objects on our screen form. Activate the object datasource1. Let's go to its property dataset. From the drop-down list, select Form1.Table1

Activate the object dbgrid1. Let's go to his event OnDblClick. Let's create a handling procedure for this event:

var Str1:String;

Str1:=Form1.Table1["code"];

Label2.Caption:="Sale by "+Form1.Table1["naimT"];

Label3.Caption:="Acquisition by "+Form1.Table1["NaimT"];

Query1.SQL.Clear;

Query1.SQL.Add("Select * from rashod where KodR="+""""+Str1+"""");

Query1.Open;

Query2.SQL.Clear;

Query2.SQL.Add("Select * from postup where KodP="+""""+Str1+"""");

Query2.Open;

To create a table that will display information about a given product, you need to create objects dbgrid2 from the component palette datacontrols, an object Query1 from the component palette bde, as well as the object DataSource2 from the component palette Data Access. Activate the object DataSource2 and select its property dataset. From the dropdown list select Query1.

Activate the object dbgrid2, stand on his property data source and select from the dropdown list DataSource2. Activate the object Query1, let's go to its property SQL and in the code editor we write select * from rashod.

By analogy, another table is created to select from the Postup table.

Conclusion

Thus, in this work, the information system "Accounting for goods in the warehouse" has been developed. This IS is designed to automate the activities of the manager. warehouse for the accounting of goods in the warehouse.

IS consists of a program and information part. Software subsystem consists of:

Ø control subsystem;

Ø database maintenance subsystem;

Ø reporting subsystem;

Ø reference subsystem.

The informational part includes a database consisting of three interconnected tables (“Product”, “Product receipt”, “Product sale”) implemented in the Paradox 7.0 format. The database contains data on the availability of goods, their receipt and sale, suppliers, buyers.

Information system developed by means of Delphi 6.0 using standard components.

IS allows you to edit information in the database, as well as to generate certificates and reports in real time (RMT). References are formed by sampling individual entries by product name. Reports are generated in the form of tables by creating from templates MS-Word documents through COM - technology.

The total volume of the developed IS is 974Kb. IS can function in any Windows compatible OS.

IN PRACTICE IN THE PROFILE OF SPECIALTY

JSCB "Svyaz-Bank"

Ulyanovsk, 20__

about the internship

There are many definitions Database, we mean by this concept the following:

Database ─ a file (document) in which information (data) is stored in a special format.

Other database definitions.

Database:

    A data file with a specific structure.

    A named collection of related data of some subject area.

    Some unified collection of data shared by a group of people.

    Electronic repositories of information accessed through one or more computers.

    Interrelated information (data) about objects organized in a special way and stored in the external memory of a computer.

    An information model that allows you to orderly store data about a group of objects that have the same set of properties.

Types of database models

        Hierarchical;

There are links between objects. One element is considered the main element, the rest are subordinate. Each object can include several objects more than low level. Graphically, it is a tree consisting of objects of different levels.

        Network;

It is a generalization of hierarchical by allowing objects that have more than one parent.

        relational;

The most common one is a generalization of the network and hierarchical database model. Consists of one or more interconnected two-dimensional tables.

    Table row - object instance (record);

    A table column is an object attribute (field).

There can be relationships between tables according to the principle main (parent, master) - subordinate (child, detail).

Database management systems

DBMS ─ a system of programs that allows you to create a database, update the information stored in it, providing convenient access to it for the purpose of viewing and searching.

Other definitions of DBMS.

DBMSsoftware, intended for:

      descriptions of data, operation (manipulation) of data;

      data management in external memory;

      data protection and integrity control, concurrent access control;

      service operations with data (administration, archiving, etc.).

DBMS─ a set of software tools designed to create the structure of the content database and edit its contents and to visualize information, i.e. for the selection of data that meets the specified criteria, their sorting and output to the screen, printer or transmission over computer networks.

DBMS─ a program with the help of which information is entered into the database, viewed, sorted, filtered, searched for, exported (translated into formats of other DBMS) or imported.

DBMSsoftware, designed to work with databases.

Subd types

    By way of execution:

    universal (Access);

    specialized (1C);

By way of accessing data:

  • local (dBase; Access; Paradox);

    network, distributed (DB servers: MS SQL Server, InterBase, Oracle, PostgreSQL).

Possibilities and purpose of subd

The main purpose of a DBMS is to give the user a simple and accessible tool that will allow him to create the kind of database that he needs.

To work with the database, the DBMS must provide:

    the ability to enter and read information;

    work with a large amount of data;

    speed of data search;

    data integrity (their consistency);

    protection from destruction, destruction, from unauthorized access;

    a system of friendly prompts (per user without special training).

Let's consider in more detail the types of database models.

Development of database forms

For information security a window for entering a login and password was created (Figure 2.3).

Figure 2.3 - Database login window

After logging in, the main page of the database is displayed, on which there are 3 Buttons for accessing the program modules, as well as a DBGrid that displays basic information about current hotel guests. (Figure 2.4)


Figure 2.4 - Main page of the database

Figure 2.5 - Request module

The form contains 4 ready-made SQL queries that will be needed for the hotel administrator. RadioButton components are used to switch between requests. There are 2 buttons on the form to return to home page and to switch to viewing the entire database. Program code in Appendix A

There is also a form for viewing all databases. You can go to it after clicking the "Browse DB" button. (Figure 2.6)

Figure 2.6 - DB view form

The form has 4 RadioButton components for switching between tables, a DBGrid component for viewing data from tables, and a DBNavigator component for managing, adding, editing, and deleting records in the database. There is also a button to go to the requests module - the Go to requests button.

For databases, the ability to create a printable report is very important. Therefore, we added a form for reports to the program (click on the "Report" button). The report was created using the components of the QuickReport tab. The report window is under development. (Figure 2.7)

For breeding necessary information into the report, used a SQL query. The query itself is written inside the ADOQuery component in the SQL property. The ADOQuery component receives information from the DM data module, which we connected to the form using the “File > Use Unit…” command. On the QuickReport form, the following lines were included in the properties: PageHeader (the header contains the date and time of the report creation), Title (the name of the report is recorded), ColumnHeader (the names of the columns for the records are recorded), Detail (used to fill the report with data from the database), PageFooter (Report pages indicated). To receive and fill in data from ADOQuery, we used the QRDBText components, set the following in the properties: DataSet - connection to ADOQuery, DataField - required columns from the database. QRlabels were also used for various signatures. The program code and the text of the request are in Appendix A.

Figure 2.7 - Report Form

After the above actions, we received a finished report (Figure 2.8)


Figure 2.8 - Finished report

Creation of online help system

DrExplane is a very easy to use, help authoring tool. Without necessary knowledge, you can quickly create a wizard HTML help(CHM), online help, PDF, and Word documents.

Ready help (Figure 2.9)

Figure 2.9 - Help

You need to create a shell to work offline with various types reference books.

All directories are divided into two types - databases and directories in html format.

The directory files themselves (structure) must be developed based on my wishes. That is, it turns out that you need to develop a shell and a file format that is “understood” by the shell.

The shell must be able to connect these directories, search them, create selections from the database, export records, sort records, edit, add own records and changes. The shell also provides for the operation of a record classifier, the creation of its own classifier (hereinafter referred to as “user groups”).

As additional features it is planned to develop a module for printing address data on envelopes, creating electronic diary, calculator.

The purpose of the shell is to work with large quantity various databases. The main database is a database of Russian enterprises.

Directory in the form of a database.

The basis of such a directory is data tables. The main table and connected tables (on the same principle as in access).

For example, there is a main table with the following fields:

Company name

City code

gas station

Yekaterinburg, Lenina, 1

Omsk, Mira, 44

Moscow, trading, 23

The fields marked with * in the example are index fields, i.e. there are two more tables that contain the transcript of these indices.

Region index

Moscow city

City index

Decryption

Yekaterinburg

In the shell, when working with the directory, already decrypted data is issued. These index tables are made to reduce the size of the directory. After all, for example, the entry "Sverdlovsk Region" can be found in the database seventy to eighty thousand times.

The above example is presented for reference, in fact, the tables are larger and the number of fields is larger.

For each such directory, there is a table of the "record classifier", i.e., an index field that refers the record to a particular group. The classifier (list) itself is taken out in separate window on the shell desktop. When you select one or another record from the classifier, a selection of records from the database is made and only those that satisfy the condition are displayed.

The directory file itself consists of several parts: the tables themselves and the following information:

Manual technical data: title, description, author, date latest update, cost, path of the page of this guide on the site (hyperlink).

An enumeration of the functions that should work in the shell with this reference.

List of fields for which a "quick search" is performed.

Record card layout.

Layout of the form for printing entries from the directory.

License Data

Record classifier table

It is planned to make the reference file itself on xml based, but here it is at the discretion of the developer. The main thing is that this format is understandable to the shell and the directory is correctly connected.

When a directory is connected, the shell reads all the data, transfers all tables to its directory, and organizes links between tables. And all functions for working with the directory are connected: search, selection, export, etc.

Handbook formathtml.

This type of reference is a set of pages and figures. A menu file is used as navigation through this directory, the contents of which are placed in the classifier window. To work with such a directory, you need to embed a simple browser into the shell. All data (pages and pictures) for the directory will be contained in the directory file, access to the Internet is not required for the shell.

Requirements for the operation of the shell should be the most minimal: big list operating systems(on the initial stage you can limit yourself to windows 9x, 2000, NT, XP), as simple as possible the technical data of the computer ( RAM, processor), should not be required to have installed additional drivers, programs. Everything necessary for the shell to work must be installed from the distribution.

All functions must be accessible and understandable to the average user.

List of all shell functions:

Directory

Connect directory

Delete directory

List of all available directories

Directory 1

Handbook 2

Handbook 3

Extended list of installed directories

Quick search

Advanced Search

Search in found

Move Record to Pocket

Clear "Pocket"

Add a note

Delete entry

Edit post

Importing data into the directory

Go to next post

Go to previous entry

Sort records in ascending order

Sort records in descending order JàA

Print setup

Print selection

Editing the output form

Printing on envelopes

Calculator

diary

Working with groups

Create a group

Edit group

Deleting a group

Add an entry to a group

Remove an entry from a group

About the program

Get a list of all available directories

Full Terms of Reference described appearance programs (location of all windows, menu items), Full description directory file structures, description of settings, directory connection process, etc.

I draw your attention to the fact that I need a program for distribution on a CD, and not Internet engines.

Unfortunately, the developer who made the shell for me disappeared without a trace, but he managed to develop the program interface. Not completely true, but it will be enough to understand what I need.

Top Related Articles