Sei sulla pagina 1di 9

114-DBMS

Data types of Access Text Data Type - It allows you to enter text or combinations of text and numbers, as well as numbers that dont require calculations. - It can accommodate up to 255 characters, though by default it allows 50 characters. - This data type is best suitable for field like name, address, city etc. Memo Data Type - It allows you to enter Lengthy text or combinations of text and numbers - Its main characteristic is that it allows user to enter up to 65,536 characters. - Mostly used for fields like address, notes, description etc. Number Data Type - It allows you to enter numerical data used for mathematical calculations. By default it allows you to enter an integer value. - Best suitable for field like marks, quantity etc. Date/Time Data Type - It allows you to enter date and time values from years 100 through 9999. - It occupies 8 bytes in memory. Currency Data Type - It allows you to enter currency values and numeric data used in mathematical calculations involving data with one or four decimal places. - Accurate to 15 digits on left side of the decimal separator and to 4 digits on the right side. - Mainly associated with fields having some monetary value. - Usually used for fields like salary, price etc.

Autonumber Data Type - It automatically enters unique sequential or random numbers whenever a new record is created in access table. - Fields with this data type cannot be updated. Yes/No Data Type - Allows user to enter only one of the two values yes/No, On/Off and True/False. - Occupies only 1 bit in the memory. OLE Object Data Type - OLE (Object Linking & Embedding) Data Type allows user to link or embed an external object like word document, excel spreadsheet, image file etc. in access table. Hyperlink Data Type - Allows the user to enter an email address or a website address. - If the outlook express is configured, this Data Type can be utilizing very well. - Generally used for fields like student_email_id, company_website etc. Lookup Wizard Data Type - A field associated with this Data Types can have a drop down list of values using a combo box or list box. - Generally used when the user has to select one value out of the predefined list of values. Object Embedding - Object embedding will create a separate copy of the object and store it in the access database. Object Linking - Object Linking will create only a link to the source object. - It will not store a separate copy in access database.

Object Linking Vs. Object Embedding 1. When an object is linked to the access table, modifications made in the source object will be reflected in the access table. Where in case of object embedding the changes will not be reflected as a separate copy of the object is saved in access table. 2. If the original path of the source object is changed or the deleted then in case of object linking you will not be able to access the file from the datasheet view of table. In case of object embedding you will be able to access the object from the datasheet view of table. Filters in Access - Filters can be used to fetch subset of records from a single table as per a specific condition or criteria. - Filters are generally created to temporarily view records meeting a given criteria. - The different types of filters are explained over here. Filter by selection - In filter by selection you have to select part of data or entire data in a field. - All records matching the selected data will be displayed on applying the filter. Filter Excluding Selection - In filter excluding selection you have to select part of data or entire data in a field. - All the records not matching the selected data will be displayed on applying the filter. - It is just opposite of filter by selection. Filter For - Right clicking in any field of the table will display the option filter for. - Most of the expressions discussed in validation rule property can be specified in filter for. Filter by Form

- This filter can be used to fetch records when one condition/ criteria is to be given in one field and second condition/criteria is to be given some other field. - This is usually done using logical OR or logical AND operators. Advance Filter/Sort - This is the best and easiest of filter available in access. - Apart from giving multiple conditions, sorting of records is also possible using advance filter/sort. Difference between filter and Queries. Filter 1 Filters are not independent objects of access. If you want to save filter it has to be saved as a query. 2 Filters are designed on a single table. 3 If only some of the fields are desired in the output it is not possible, filters display the entire record in the output. 4 Filter cannot add or modify data in a table. 5 Group/Aggregate functions cannot be used in filters. Queries Queries are independent objects of access. Query can be saved independently as a query. Queries can be designed on multiple tables. Only those fields which are desired in the output can be displayed, not necessary to display entire record. Action queries help us to add or modify data in a table. Group/Aggregate functions can be used in queries.

Queries

Parameter Query: - Parameter queries are queries where the criteria can be specified at the run time instead of design time. To design a parameter query, a variable is specified in [ ] in criteria at design time. Access will ask for the value at run time. Simple Query: - Normally queries are used to fetch data based on some specific condition. Action Query: - Action queries are different from the normal select queries. Action queries can be used to create a new table from some existing table, add records in a table, update values in a table or delete some specific record from table. Crosstab Query: - Generally in normal tables or queries the information is like a single dimension, i.e. the column headings are on top and the information is given below it. Crosstab queries present the summary/results almost in a two dimensional form. This is specifically useful when the grouping is done on two fields. One group values will be displayed as column heading and another as row heading. To design a Crosstab query, you need at least three fields- one for column heading, second for row heading and third for values. Query Wizard You can easily create some simple queries with the help of a wizard. Here two special queries that can be designed with the help of wizard are discussed: Find Duplicates Query Wizard Find duplicates query wizard creates a query that finds records that have duplicate field values and are in a single table or query. Find Unmatched Query Wizard Find unmatched query wizard creates a query that finds records in one table that have no related records in another table.

Controls on a form Combo Box Control: - The combo box control is basically used to display a drop down list of values to the user. This means that there can be multiple rows in the list. A bound combo box is often used for the foreign key field of the child table. Here the source will be primary key of parent table. An unbound combo box can also be there, that allow you to select a value from a list of value but does not store the value. Essential Properties: Control Source: - Include the field with which the combo box control is bound to. Record Source Type: - This property actually indicates whether the control is bound or unbound i.e. the drop down list is going to have a static list of values or the values are going to come from some other table/Query. Row Source: - Here you have to write the query i.e. select statement through which the records will be selected. Bound Column: - The combo box is basically a drop down list in which each row may consist of one or more column. The value from one of the column has to be stored in the field of the underlying table. Usually it is set to 1. Limit to List: - This property can contain value Yes or No. If you want to enter some other values apart from the drop down list of values that are displayed then set Yes. By default always Yes. List Box Control: - The List box control is similar to combo box control. But there is major different between combo box and list box is that in the list box there is no Limit to List property. Hence you cannot enter a value which is not there in the list of values in the drop down list.

Tab Control: - Tab controls are generally used when the number of fields to be included at a single place is quite large, specifically when the fields can be grouped in to various categories. Information of each category can be maintained on a separate tab page. By default access includes two tab pages. Caption is the main property used over here to give heading to a tab page. Tab control is an unbound control. Command Button: - Command button provide you with a way of performing action(s) by simply clicking them. When you choose the button, it not only carries out the appropriate action, it also looks as if its being pushed in and released. Command buttons are mainly used to perform some record navigation (first, next, previous and last) and record operations (add, delete, save etc.). Option Button/Check Box/Toggle Button:- The three controls mentioned above have got almost similar functionality. These controls can be used in a form or report especially for a field with Yes/No Data type. These controls are bound controls. Option Group: - You can use an option group on a form or report to display a limited set of alternatives. An option group makes selecting a value easy because you can just click the value that you want. Only one option in an option group can be selected at a time. Subforms: - A subform is a form that is inserted in another form. The primary form is called the main form, and the form within the form is called the subform. Subforms are especially effective when you want to show data from tables or queries with one-to-many relationship. Reports

Reports are a very effective way to represent data. Most reports are bound to one or more table and query in the database. Macros Macros are a set of actions that you can create to help you to automate common tasks. By using set of macros, you can perform several tasks at once. Macros are basically designed for some repetitive actions that are required to be executed again and again. Macro is also independent object of access. Macro Group: - If you have numerous macros, grouping related macro groups can help you to manage your database more easily. Autokeys Macro: - You can assign an action or set of actions to a specific key or key combination by creating an Autokey macro group. When you press the key or key combination, Microsoft access carries out the action. The following combinations you can use to make key assignments in an Autokeys macro group. Keys Syntax Key Combination ^A or ^4 {F1} ^{F1} +{F1} {INSERT} ^{INSERT} +{INSERT} {DELETE} or {DEL} ^{DELETE} or ^{DEL} CTRL+A or CTRL+4 F1 CTRL+F1 SHIFT+F1 INS CTRL+INS SHIFT+INS DEL CTRL+DEL

+{DELETE} or +{DEL}

SHIFT+DEL

Autoexec Macro: - This is another special macro in access a macro can be saved with the name autoexec. This macro does not include macro names. This macro only contains a set of actions. Every time the user opens the database containing autoexec macro, the set of actions in this macro will be executed first. Switchboard Switchboard form is one type of form in access where you do not have to do any data entry. This form basically provides some easy interface to interact with the database. You can use switchboard forms to restrict access to only specific objects of database. Switchboard consists of number of pages/forms each can be linked with one another.

Potrebbero piacerti anche