Вы находитесь на странице: 1из 26

S.NO.

PARTICULARS

PG SIGHN NO.

Microsoft Access
Developer(s) Initial release Stable release Development status Operating system Type License Website Microsoft Corporation November 1992; 20 years ago 2013 (15.0.4420.1017) / October 2, 2013; 7 months' time Active Microsoft Windows DBMS Trialware office.microsoft.com/access

Microsoft Access, also known as Microsoft Office Access, is a database management system from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software-development tools. It is a member of the Microsoft Office suite of applications, included in the Professional and higher editions or sold separately. On May 12, 2010, the current version of Microsoft Access 2010 was released by Microsoft in Office 2010; Microsoft Office Access 2007 was the prior version. Microsoft Access stores data in its own format based on the Access Jet Database Engine. It can also import or link directly to data stored in other applications and databases.[1] Software developers and data architects can use Microsoft Access to develop application software, and "power users" can use it to build software applications. Like other Office applications, Access is supported by Visual Basic for Applications, an objectoriented programming language that can reference a variety of objects including DAO (Data Access Objects),ActiveX Data Objects, and many other ActiveX components. Visual objects used in forms and reports expose their methods and properties in the VBA programming

environment, and VBA code modules may declare and call Windows operatingsystem functions.

Features
Users can create tables, queries, forms and reports, and connect them together with macros. Advanced users can use VBA to write rich solutions with advanced data manipulationand user control. Access also has report creation features that can work with any data source that Access can "access". The original concept of Access was for end users to be able to "access" data from any source. Other features include: the import and export of data to many formats includingExcel, Outlook, ASCII, dBase, Paradox, FoxPro, SQL Server, Oracle, ODBC, etc. It also has the ability to link to data in its existing location and use it for viewing, querying, editing, and reporting. This allows the existing data to change while ensuring that Access uses the latest data. It can perform heterogeneous joins between data sets stored across different platforms. Access is often used by people downloading data from enterprise level databases for manipulation, analysis, and reporting locally. There is also the Jet Database format (MDB or ACCDB in Access 2007) which can contain the application and data in one file. This makes it very convenient to distribute the entire application to another user, who can run it in disconnected environments. One of the benefits of Access from a programmer's perspective is its relative compatibility with SQL (structured query language) queries can be viewed graphically or edited as SQL statements, and SQL statements can be used directly in Macros and VBA Modules to manipulate Access tables. Users can mix and use both VBA and "Macros" for programming forms and logic and offers object-oriented possibilities. VBA can also be included in queries. Microsoft Access offers parameterized queries. These queries and Access tables can be referenced from other programs like VB6 and .NET through DAO or ADO. From Microsoft Access, VBA can reference parameterized stored procedures via ADO. The desktop editions of Microsoft SQL Server can be used with Access as an alternative to the Jet Database Engine. This support started with MSDE (Microsoft SQL Server Desktop Engine), a scaled down version of Microsoft SQL Server 2000, and continues with the SQL Server Express versions of SQL Server 2005 and 2008. Microsoft Access is a file server-based database. Unlike clientserver relational database management systems (RDBMS), Microsoft Access does not implement database triggers, stored procedures, or transaction logging. Access 2010 includes table-level triggers and stored procedures built into the ACE data engine. Thus a Client-server database system is not a requirement for using stored procedures or table triggers with Access 2010. Tables, queries, Forms, reports and Macros can now be developed specifically for web base application in Access 2010. Integration with Microsoft SharePoint 2010 is also highly improved.

Uses
In addition to using its own database storage file, Microsoft Access also may be used as the 'front-end' with other products as the 'back-end' tables, such as Microsoft SQL Serverand nonMicrosoft products such as Oracle and Sybase. Multiple backend sources can be used by a Microsoft Access Jet Database (accdb and mdb formats). Similarly, some applications will only use the Microsoft Access tables and use another product as a front-end, such as Visual Basic or ASP.NET. Microsoft Access may be only part of the solution in more complex applications, where it may be integrated with other technologies such as Microsoft Excel, Microsoft Outlook or ActiveX Data Objects. Access tables support a variety of standard field types, indices, and referential integrity. Access also includes a query interface, forms to display and enter data, and reports for printing. The underlying Jet database, which contains these objects, is multiuser-aware and handles recordlocking and referential integrity including cascading updates and deletes. Repetitive tasks can be automated through macros with point-and-click options. It is also easy to place a database on a network and have multiple users share and update data without overwriting each other's work. Data is locked at the record level which is significantly different from Excel which locks the entire spreadsheet. There are template databases within the program and for download from their website. These options are available upon starting Access and allow users to enhance a database with predefined tables, queries, forms, reports, and macros. Templates do not include VBA code. Programmers can create solutions using the programming language Visual Basic for Applications (VBA), which is similar to Visual Basic 6.0 (VB6) and used throughout theMicrosoft Office programs such as Excel, Word, Outlook and PowerPoint. Most VB6 code, including the use of Windows API calls, can be used in VBA. Power users and developers can extend basic end-user solutions to a professional solution with advanced automation, data validation, error trapping, and multi-user support. The number of simultaneous users that can be supported depends on the amount of data, the tasks being performed, level of use, and application design. Generally accepted limits are solutions with 1 GB or less of data (Access supports up to 2 GB) and performs quite well with 100 or fewer simultaneous connections (255 concurrent users are supported). This capability is often a good fit for department solutions. If using an Access database solution in a multi-user scenario, the application should be "split". This means that the tables are in one file called the back end (typically stored on a shared network folder) and the application components (forms, reports, queries, code, macros, linked tables) are in another file called the front end. The linked tables in the front end point to the back end file. Each user of the Access application would then receive his or her own copy of the front end file. Applications that run complex queries or analysis across large datasets would naturally require greater bandwidth and memory. Microsoft Access is designed to scale to support more data and users by linking to multiple Access databases or using a back-end database like Microsoft

SQL Server. With the latter design, the amount of data and users can scale to enterpriselevel solutions. Microsoft Access's role in web development prior to version 2010 is limited. User interface features of Access, such as forms and reports, only work in Windows. In versions 2000 through 2003 an Access object type called Data Access Pages created publishable web pages. Data Access Pages are no longer supported. The Microsoft Jet Database Engine, core to Access, can be accessed through technologies such as ODBC or OLE DB. The data (i.e., tables and queries) can be accessed by web-based applications developed inASP.NET, PHP, or Java. Access 2010 allows databases to be published to SharePoint 2010 web sites running Access Services. These web-based forms and reports run in any modern web browser. The resulting web forms and reports, when accessed via a web browser, don't require any add-ins or extensions (e.g. ActiveX, Silverlight). A compiled version of an Access database (File extensions: .MDE /ACCDE or .ADE; ACCDE only works with Access 2007 or later) can be created to prevent user from accessing the design surfaces to modify module code, forms, and reports. An MDE/ACCDE file is a Microsoft Access database file with all modules compiled and all editable source code removed. An ADE file is an Access project file with all modules compiled and all editable source code removed. Both the .MDE/ACCDE and .ADE versions of an Access database are used when end-user modifications are not allowed or when the applications source code should be kept confidential

COMPONENTS IN MS-ACCESS Tables


A database table is similar in appearance to a spreadsheet, in that data is stored in rows and columns. As a result, it is usually quite easy to import a spreadsheet into a database table. The main difference between storing your data in a spreadsheet and storing it in a database is in how the data is organized. To get the most flexibility out of a database, the data needs to be organized into tables so that redundancies don't occur. For example, if you're storing information about employees, each employee should only need to be entered once in a table that is set up just to hold employee data. Data about products will be stored in its own table, and data about branch offices will be stored in another table. This process is called normalization. Each row in a table is referred to as a record. Records are where the individual pieces of information are stored. Each record consists of one or more fields. Fields correspond to the columns in the table. For example, you might have a table named "Employees" where each record (row) contains information about a different employee, and each field (column) contains

a different type of information, such as first name, last name, address, and so on. Fields must be designated as a certain data type, whether it's text, date or time, number, or some other type. Another way to describe records and fields is to visualize a library's old-style card catalog. Each card in the cabinet corresponds to a record in the database. Each piece of information on an individual card (author, title, and so on) corresponds to a field in the database.

Forms
Forms are sometimes referred to as "data entry screens." They are the interfaces you use to work with your data, and they often contain command buttons that perform various commands. You can create a database without using forms by simply editing your data in the table datasheets. However, most database users prefer to use forms for viewing, entering, and editing data in the tables. Forms provide an easy-to-use format for working with the data, and you can also add functional elements, such as command buttons, to them. You can program the buttons to determine which data appears on the form, open other forms or reports, or perform a variety of other tasks. For example, you might have a form named "Customer Form" in which you work with customer data. The customer form might have a button which opens an order form where you can enter a new order for that customer. Forms also allow you to control how other users interact with the data in the database. For example, you can create a form that shows only certain fields and allows only certain operations to be performed. This helps protect data and to ensure that the data is entered properly.

Reports
Reports are what you use to summarize and present data in the tables. A report usually answers a specific question, such as "How much money did we receive from each customer this year?" or "What cities are our customers located in?" Each report can be formatted to present the information in the most readable way possible. A report can be run at any time, and will always reflect the current data in the database. Reports are generally formatted to be printed out, but they can also be viewed on the screen, exported to another program, or sent as e-mail message.

Queries
Queries are the real workhorses in a database, and can perform many different functions. Their most common function is to retrieve specific data from the tables. The data you want to see is usually spread across several tables, and queries allow you to view it in a single datasheet. Also, since you usually don't want to see all the records at once, queries let you add criteria to "filter" the data down to just the records you want. Queries often serve as the record source for forms and reports. Certain queries are "updateable," meaning you can edit the data in the underlying tables via the query datasheet. If you are working in an updateable query, remember that your changes are actually being made in the tables, not just in the query datasheet. Queries come in two basic varieties: select queries and action queries. A select query simply retrieves the data and makes it available for use. You can view the results of the query on the screen, print it out, or copy it to the clipboard. Or, you can use the output of the query as the record source for a form or report. An action query, as the name implies, performs a task with the data. Action queries can be used to create new tables, add data to existing tables, update data, or delete data.

Macros
Macros in Access can be thought of as a simplified programming language which you can use to add functionality to your database. For example, you can attach a macro to a command button on a form so that the macro runs whenever the button is clicked. Macros contain actions that perform tasks, such as opening a report, running a query, or closing the database. Most database operations that you do manually can be automated by using macros, so they can be great time-saving devices.

Modules
Modules, like macros, are objects you can use to add functionality to your database. Whereas you create macros in Access by choosing from a list of macro actions, you write modules in the Visual Basic for Applications (VBA)programming language. A module is a collection of declarations, statements, and procedures that are stored together as a unit. A module can be either a class module or a standard module. Class modules are attached to forms or reports, and usually contain procedures that are specific to the form or report they're attached to. Standard modules contain general procedures that aren't associated with any other object.

Standard modules are listed under Modules in the Navigation Pane, whereas class modules are not.

PAGES
Microsoft Access's role in web development prior to version 2010 is limited. User interface features of Access, such as forms and reports, only work in Windows. In versions 2000 through 2003 an Access object type called Data Access Pages created publishable web pages. Data Access Pages are no longer supported. The Microsoft Jet Database Engine, core to Access, can be accessed through technologies such as ODBC or OLE DB. The data (i.e., tables and queries) can be accessed by web-based applications developed inASP.NET, PHP, or Java.

How to Create a New Database in Microsoft Access


Microsoft Office Access 2007 helps you track and report information with ease. Creating a new database is extremely simple and will prove to be very effective. Please see the steps below for more detailed information.

Steps 1. 1

1.

Open Microsoft Access 2007, and click on the Blank database icon

2
2. Browse to the folder that you want to create the file in

3. 3

3. Change the database name to what ever you want to call it and hit create.

EditTips
When changing the database name, you can also change the extension from *.accdb to *.mdb if you want. The MBD extension is more accessible if more then one person is working on the file they all might not have Access 2007.

Database of the name ROHAN JAIN

1. Open MICROSOFT ACCESS and click on the blank database icon

2. Browse to the folder you want to create the database in . Enter the name you want to give and click create.

3. Database of name ROHAN JAIN has been created.

TABLE WITH THE NAME EMPLOYEE, 15 ROWS AND 6 COLOUMNS

Table Employee with following data:

Field Name EID Ename Salary Resume Project_Files DOJ

Datatype Number Text Number Attachment OLE Date

Description The unique identifier for an employee The name of each employee The salary taken by employee The resume of each employee The files made by employee The date of joining of employee

STEP 1.)

STEP 2.) RESULT

VALIDATION RULE Validation Rules


Validation rules prevent bad data being saved in your table. Basically, they look like criteria in a query. You can create a rule for a field (lower pane of table design), or for the table (in the Properties box in table design.) Use the table's rule to compare fields. There is one trap to avoid. In some versions of Access, you will not be able to leave the field blank once you add the validation rule, i.e. you must enter something that satisfies the rule. If you need to be able to leave the field blank, add OR Is Null to your rule. (Some versions accept Nulls anyway, but we recommend
you make it explicit for clarity and consistency.)

This article explains how to use validation rules, and concludes with some thought provoking on when to use them.

Validation Rules for fields


When you select a field in table design, you see its Validation Rule property in the lower pane.

This rule is applied when you enter data into the field. You cannot tab to the next field until you enter something that satisfies the rule, or undo your entry.

Validation Rules for tables


In table design, open the Properties box and you see another Validation Rule. This is the rule for the table. The rule is applied after all fields have been entered, just before the record is saved. Use this rule to compare values across different fields, or to delay validation until the last moment before the record is saved.

When to use validation rules


In designing a database, you walk a tightrope between blocking bad data and accepting anything. Ultimately, a database is only as good as the data it contains, so you want to do everything you can to limit bad data. On the other hand, truth is stranger than fiction, and your database must handle those weird real-world cases where the data exceeds the bounds of your imagination.

Field's validation rule


Take a BirthDate field, for example. Should you create a rule to ensure the user doesn't enter a future date? We would need some radically different physics to ever be entering people who are not yet born, so it sounds like a safe enough rule? But did you consider that the computer's date might be wrong? Would it be better to give a warning rather than block the entry? The answer to that question is subjective. The question merely illustrates the need to think outside the box whenever you will block data, not merely to block things just because you cannot imagine a valid scenario for that data. Validation Rules are absolute. You cannot bypass them, so you cannot use them for warnings. To give a warning instead, use an event of your form, such as Form_BeforeUpdate.

Table's validation rule


We suggested using this rule for comparing fields. In the ideal database design, the fields are not dependent on each other, so if you are comparing fields, you might consider whether there is another way to design the table. Our first example above ensures that a booking does not end before it starts. There is therefore a dependency between these two fields. Could we redesign the table without that dependency? How about replacing EndDate with a Duration field? Duration would be a number in an applicable unit (e.g. days for hotel bookings, periods for school classrooms, or minutes for doctors appointments.) We use a calculated field in a query to get the EndDate. This may not be the best design for every case, but it is worth considering when you go to use the record-level validation rule.

Limitations
You cannot use a validation rule where:

You want to call user-defined functions, or VBA functions beyond the ones in JET such as IIf() and Date(). The user should be able to bypass the rule. The expression is too complex. The expression involves data in other records or other tables. (Well, not easily, anyway.)

Alternatives
Use these alternatives instead of or in combination with validation rules: Required: Setting a field's Required property to Yes forces the user to enter something. (In addition to the obvious cases, always consider setting this to Yes for your foreign key fields. See #3 in this article for details.) Allow Zero Length: Setting this property to No for text, memo, and hyperlink fields prevents a zero-length string being entered. A ZLS is not the same as a Null, so if you permit this you have confusing data for the user, more work checking for both as a developer, more chance of a mistake, and slower executing queries. More information in Problem Properties. Indexed: To prevent duplicates in a field, set this property to Yes (No Duplicates). Using the Indexes box in table design, you can create a multi-field unique index to the values are unique across a combination of fields. Lookups: Rather than creating a validation rule consisting of a list of valid values, consider creating a related table. This is much more flexible and easier to maintain. Input Mask: Of limited use. Users must enter the entire pattern (without them you can enter some dates with just 3 keystrokes, e.g. 2/5), and they cannot easily insert a character if they missed one.

Conclusion
Validation rules are very useful for keeping bad data out of your tables, but be careful not to overdo them. You don't want to block things that might be valid, though unexpected.

VALIDATION TEXT
When your query encounters a constraint violation, by default Microsoft Access displays a message from Microsoft SQL Server. If your Access project is connected to a SQL Server 2000 database, you can create and show a more user-friendly message using the Validation Text property. 1. In the Database window, click Tables under Objects, select the table you want, and then click Open on the database window toolbar. 2. Right click on the Design grid, and then select Constraints. 3. In the selected constraint list box, select the constraint you want, or click New to create a new constraint.

4. Type the user message in the Validation Text text box as the following examples show. IF THE CONSTRAINT EXPRESSION TYPE THE VALIDATION TEXT: IS: MinJobLevel > 10 "The job level is too low. You must enter a number greater than 10." "Please enter a household name." "You must enter a positive number."

HouseholdName Is Not Null Quantity >= 0

5. Close the Properties sheet to save your changes. NOTE The Validation Text property is ignored in an unbound form that fills in control values directly fromADO. In this case, you must trap the error and display the validation text in your code.

What Are Table Relationships


In a relational database, relationships enable you to prevent redundant data. For example, if you are designing a database that will track information about books, you might have a table called Titles that stores information about each book, such as the books title, date of publication, and publisher. There is also information you might want to store about the publisher, such as the publisher's phone number, address, and zip code. If you were to store all of this information in the titles table, the publishers phone number would be duplicated for each title that the publisher prints. A better solution is to store the publisher information only once in a separate table, Publishers. You would then put a pointer in the Titles table that references an entry in the Publishers table. To make sure that your data is not out of sync, you can enforce referential integrity between the Titles and Publishers tables. Referential integrity relationships help ensure that information in one table matches information in another. For example, each title in the Titles table must be associated with a specific publisher in the Publishers table. A title cannot be added to the database for a publisher that does not exist in the database.

How to Define Relationships Between Tables


When you create a relationship between tables, the related fields do not have to have the same names. However, related fields must have the same data type unless the primary key field is an AutoNumber field. You can match an AutoNumber field with a Number field only if the FieldSize property of both of the matching fields is the same. For example, you can match an AutoNumber field and a Number field if the FieldSize property of both fields is Long Integer. Even when both matching fields are Number fields, they must have the same FieldSize property setting.

Two tables Employee and Department with relationship between these tables TABLE 1

TABLE 2

QUERY DEPICTING RELATIONSHIP BETWEEN THE TWO TABLES

A table showing query to select records of those students who have not paid the fees. (Using Query Design)

A query to select those records that have A grade in Maths & B Grade in Computer. (Use Query Design)

A table Sales with fields ID, Price1, Price2, Quantity.


(Use Query Design)

1. Calculate Sum of Price1 and Price2 and store it in TotalSum 2. Perform TotalSum * Quantity and store it in a Total Variable

SALES TABLE

RESULT

Form and how it helps in displaying data


Access allows the user to create "forms" and "reports". A form shows one record in a user-designed format and allows the user to step through records one at a time. A report shows selected records in a user-designed format, possibly grouped into sections with different kinds of total (including sum, minimum, maximum, average).

Here are the steps involved in creating a form in Access.


Ensuring the "Forms" tab is selected, click "New". Select "Form Wizard" and click "OK". (For now, we'll use the "Form Wizard" to create a form. Once you become comfortable with creating forms, you can choose another option if you prefer). Select the fields that you need on your form and click "Next". In this case, we only need the user to enter first name and last name, so we choose those two fields: Choose which layout you'd like your form to use. Leave this at the default ("Columnar") and click "Next": Choose which style you'd like your form to use. Leave this at the default ("Clouds") and click "Next": Choose a name for your form and click "Finish":
Your form should now look something like this:

Вам также может понравиться