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

Microsoft Access Tutorial This Microsoft Access tutorial is aimed at anyone who wishes to learn how to use Microsoft

Access. It assumes a basic understanding of databases and how they work. If you don't currently have an understanding of how databases work, don't despair - I have written a basic database tutorial just for you! That tutorial covers the basic concepts of databases, and the examples use Microsoft Access, so that will make it easier for you once you return here. Table of Contents This tutorial consists of the following lessons 1. About Microsoft Access 2. Create a Database 3. Create a Table 4. Adding Data 5. Create a Form 6. Modify a Form 7. Create a Query 8. Modify a Query 9. Create a Macro 10. Convert Access Database to Excel 11. Microsoft Access versus SQL Server 12. Summary Microsoft Access is a Relational Database Management System (RDBMS), designed primarily for home or small business usage. Access is known as a desktop database system because it's functions are intended to be run from a single computer. This is in contrast to a server database application (such as SQL Server), where it is intended to be installed on a server, then accessed remotely from multiple client machines. Microsoft (or MS) Access is a software package that you install just like any other software package, and is bundled as part of the Microsoft Office suite. Access Versus Excel You may be wondering what the benefits of using Access are compared with using an Excel spreadsheet. Well, it really depends on what you want to do with the data that you're storing and how much data you intend to store. Excel may be fine if you've only got a small amount of data, and if you don't have many attributes against each piece of data. It may be fine if you don't have much in the way of relational data across multiple worksheets. Once you start storing many attributes against each piece of data, and perhaps you find yourself repeating information across multiple worksheets, then it's time to start using Access (or another database system if you prefer). Another important reason for using Access over Excel is, if you need to generate a lot of queries and reports. Access is much better suited for doing this compared to Excel. Microsoft Access Database File Extension When you create (and save) a database in Microsoft Access, the database is saved with a .mdb extension. This is the file extension you will use the most, when developing Access databases. Once you've established your database, you also have the option of saving it as an MDE file, which gives you some benefits over the MDB file. An MDE file uses a .mde extension. Downloading Microsoft Access If you don't currently have Microsoft Access installed on your computer, you can download it from the official MS Access website. Access Versions

As with most software products, new versions of Microsoft Access are occasionally released. If the screenshots in the tutorial don't look exactly like the screens on your computer, don't worry too much. Most of the basic functions remain consistent between versions of Access. Having said that, I will endeavour to review this tutorial from time to time to ensure I cater for later versions of Access. Microsoft Access - Create a Database Creating a database in Microsoft Access is relatively straightforward. This lesson demonstrates how to create a database. 1. You may notice that, whenever you start Microsoft Access, you see the following screen. In this case, you can simply select "Blank Database".

If you already have Access open, you can go to the "File" menu and click on "New Database":

2. Choose "Blank Database". (Skip this step if you already chose "Blank Database" at step one). You also have the ability to choose from a template, but we'll just use a blank database here:

1.3.

Choose a location to save the database:

Your New Database Once you've completed the above tasks, you should see a blank database, like this:

We know this database is blank because it doesn't have any tables. If it did, you would see these tables in the middle pane of the table tab. Now that we have our blank database, we can start adding some tables. << About Access Create a Table >> Microsoft Access - Create a Table With database management systems, you need to create your tables before you can enter data. Microsoft Access makes creating tables a breeze. Using our blank database from a previous lesson, we are going to create a table called Individual. This table will have 4 columns: IndivdidualId, FirstName, LastName, and DateCreated. Design View "Design View" enables you to create your database tables and specify the columns and their data types etc. The following steps demonstrate how to switch to Design View and create a table.

1. Ensuring you have your blank database open and you're on the following screen (with the "Tables" tab selected), click "New":

1.2.

Select "Design View" and click "OK":

2.3. Fill out the details in the "Field Name" column and the "Data Type" column. Here, we are creating the column names and specifying the type of data that can be entered into them. Restricting the data type for each column is very important and helps maintain data integrity. For example, it can prevent us from accidentally entering an email address into a field for storing the current date. Other options for each column include restricting the length of data (under "Field Size"), setting a default value (this is used if someone leaves the field blank), specifying

whether the data is required, and more. Leave these options with their default value for now.

3.4.

Click the "Save" icon, enter the table name ("Individual"), and click "OK":

4.5. When prompted to set a primary key, click "Yes". (A primary key ensures that the data in this column is unique - no two values can be the same. This is important for when you need to select or reference data from this column):

Datasheet View You have now created a database table called "Individual". You can now switch between "Design View" and "Datasheet View" as you wish. Datasheet View allows you to see any data that has been entered into the table. 1. From the "View" dropdown icon, click "Datasheet View" (this changes the view from Design View, to Datasheet View):

2. You should now see something like this:

We have just created a database table. This table doesn't have any data yet, but we have created the columns that are required before any data is entered. Microsoft Access - Adding Data In Microsoft Access, there are two primary methods of adding data to your database. Strictly speaking, there is a third method (using SQL), but we'll save that for later. Here's an explanation of the two main methods. Direct entry You can type directly into the table while it's in Data Sheet view. Initially, this may seem like the quickest and easiest method, but it's not suitable if you have lots of data, and/or if non-technical users need to enter data.

Form

You can set up a form, so that non-technical users can enter data into the form. Once they submit the form, the data is automatically inserted into our table. The form could insert data into multiple tables too - saving you from having to open up each table to manually insert the data. Access provides a form wizard, which steps you through the process to building a form. We'll cover this in the next lesson.

Microsoft Access - Create a Form As mentioned in the previous lesson, forms provide non-technical users the ability to add data to your database. Here are the steps involved in creating a form in Access. 1. Ensuring the "Forms" tab is selected, click "New". 2. 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).

3. 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:

4. Choose which layout you'd like your form to use. Leave this at the default ("Columnar") and click "Next":

5. Choose which style you'd like your form to use. Leave this at the default ("Clouds") and click "Next":

6. Choose a name for your form and click "Finish":

Your form should now look something like this:

This is a very basic form and in most cases, you'd have a lot more fields on your form. You can see that the form is already presenting the first record in our Individual table. To jump to the next record, click the button. To jump to the last record, click the button. To jump past the last record so that it's blank and ready for a new record to be entered, click the button. Microsoft Access - Modify a Form In the previous lesson, we used the "Form Wizard" to create a form. In this lesson, we're going to modify the form. At the end of that lesson, we were able to see our form in "Form View". Form View is the way the form is intended to be viewed by the user. If we want to modify it, we need to switch to "Design View". Selecting "Design View" To switch to Design View, select "Design View" from the "File" menu:

Enlarging the Form To make the form taller, click on the "Form Footer" panel and drag it down. To make the form wider, click on the edge of the form and drag it across:

Adding a Field Let's say we want to add the IndividualId field to the form. To do this: 1. Select "Field List" from the "View" menu:

1.2. You should now see a "Field List" panel. From this panel, click and drag the field you want onto the form area. When you release your mouse, the field will be added to the form:

Re-arranging the Fields You might have noticed that the label for our fields appear exactly as the name of the field. This is OK, but we have no space between multiple words (i.e. "FirstName" appears instead of "First Name"). You can fix this by simply clicking in the label area and re-wording the label. Also, while we're changing the form around, let's move the IndividualId field to the top of the form. To move the fields around, click on the edge of the field and hold your mouse down. When you see the cursor turn into a hand, reposition the field to the new location, then release the mouse. You can re-size a field by clicking the edge and dragging once your cursor turns in to a twoheaded arrow.

Properties For any element that you select, you can view/change its properties. To view the properties panel, select "Properties" from the "View" menu. The following screenshot shows that we are viewing the properties for the IndividualId text box. The "Data" tab is selected, which shows us the source of the data to populate the text box. The "Formatting" tab enables us to change the way the field is displayed.

Viewing the Result Of course, you can always switch back to Form View at any time to see what your form looks like. You can see by this example that I changed the property of the labels so that their font weight is bold:

Microsoft Access - Create a Query A "query" refers to the action of instructing the database to return some (or all) of the data in your database. In other words, you are "querying" the database for some data that matches a given criteria. For example, you might like to see a list of all individuals whose first name is "Homer". Or you might like to see a list of all users who have registered with your database over a given time period. To do this, you need to do a query. Here's how to create a query in Microsoft Access: 1. Ensuring you have the "Query" tab open, click "New" 2. Select "Simple Query Wizard" and click "OK":

3. Choose the fields you'd like to be presented in the results of your query. To choose 1 field at a time, select it and click the ">" arrow. To choose all fields click the ">>" arrows.

For now, just select the "FirstName" and "LastName" fields, then click "Next":

4. Choose a name for your query and click "Finish":

The Result You should now see something like this:

At this stage, you may be thinking that there's not much difference between the results of our query and our table. We can still see all records from our table. The only difference is that we can only see 2 fields instead of all 4 fields. Well if that's what you're thinking, you'd be right! In our next lesson, we're going to modify our query so that we can only see some of the results. Microsoft Access - Modify a Query In the previous lesson, we created a query using the "Simple Query Wizard". In this lesson, we will modify that query using "Design View". 1. From Datasheet View, switch to Design View by clicking on the Design View icon (from the tool bar): (If you can't see this icon, select "Design View" from the "View" menu). You should now see something like this:

The top panel shows us the tables that are used in this query (we only use one table in our query). The bottom panel is where we specify what to do with each field in the table. We can nominate to display a field or not display it. We can sort the results by any of these fields. We can also provide criteria to be used in filtering the results. We'll do this in the next step. 2. In the "Criteria" cell for the "FirstName", add the word "Homer". While you're there, add the IndividualId field so that it will also be displayed in our results. Do this by selecting "IndividualId" from the dropdown menu on the third column. Also, ensure that the "Show"

checkbox is checked:

The Result Now when you switch back to Datasheet View, you should now see something like this:

So you can see that, once we get a lot more data into our database, queries can be very useful. Imagine if there were 100 individuals in our database called "Homer". You could also add criteria into the "Or" field. For example, you might want to search for individuals called either "Homer" or "Barney". You may need to practice this to get a good understanding of what it can do. Switch back and forth between Design View and Datasheet View as many times as you like. Change the criteria, add some fields, show fields, don't show them... Once you become familiar with queries, you'll realise the true benefits of database management systems. Convert Access Database to Excel

A very common question many people have when learning Access is "how do I convert an Access database to an Excel spreadsheet?". What they usually mean is, "how do I export the data from my Access database to an Excel spreadsheet". Often they want to do this because they need to distribute the data to someone else who may not have Microsoft Access. Also, in most cases, it's better to send someone a simple spreadsheet containing exactly the data they require, than to send them the whole database and then say, "run the Individual query". In any case, it's very easy to export data from Access to Excel. You can either export the contents of a table, or the result of a query. Here's how you go about doing this. 1. Click on the table or query that contains the data you want to export 2. From the "File" menu, click "Save As/Export" 3. Select "To an External File or Database"

4. Choose a location for your Excel spreadsheet (or double click on an existing one) You now have an Excel spreadsheet containing the data from your query that you can email to anyone you like. sMicrosoft Access Versus SQL Server As we near the end of this tutorial, you may be thinking "Microsoft Access seems to have some great features, why would I want to use any other database package?". In particular, if you've heard about SQL Server, you may be wondering what the difference is between Microsoft Access and SQL Server. Now that you've learned how to use MS Access, there are some very good reasons why you wouldn't use it in some cases. Here's a rundown on Microsoft Access versus SQL Server. MS Access Access is more suited for desktop use with a small number of users accessing it simultaneously. One reason you might choose to use Access over SQL Server is for compatibility/sharing. You might need to email someone a copy of your database. People are more likely to have Access

on their desktop computer than SQL Server. You'll generally only find SQL Server on developers' computers/servers or on production server machines. Another reason you might use Access instead of SQL Server is money. You might already have installed Access as part of the Microsoft Office suite. Purchasing SQL Server would be an extra expense that may not be necessary - depending on your situation. SQL Server can also be quite expensive. MS SQL Server SQL Server is a more robust database management system. SQL Server was designed to have many hundreds, or even thousands of users accessing it at any point in time. Microsoft Access on the other hand, doesn't handle this type of load very well. This makes SQL Server perfectly suited for database driven websites. You should never use Access for a database driven website - unless it has a very small amount of traffic (like you and a few of your friends). Even then, you may find yourself getting errors due to multiple users trying to access the database at the same time. SQL Server also contains some advanced database administration tools that enable organisations to schedule tasks, receive alerts, optimize databases, configure security accounts/roles, transfer data between other disparate sources, and much more. So Which One - Microsoft Access or SQL Server? You need to make the decision. It may already be made for you. If you've just finished this whole tutorial, then there's a good chance you already have MS Access. This probably means that you've got good reason to use Access. If you do think you need to upgrade to SQL Server, don't panic - it's not a scary as you might think! And you didn't just waste your time learning Access. You will find that SQL Server is similar in many ways to Access. Now that you know your way around Access, you should be able to relate to SQL Server much better. In any case, I recommend learning about SQL Server and SQL (Structured Query Language), especially if you're interested in a career in developing database driven websites. This will provide you with a better understanding of database systems in general and how everything fits together.

How to Link Forms in Access 2007


By Joshua Laud, eHow Contributor

Print this article

When creating user forms in Microsoft Office Access 2007, you will want to make sure these forms are linked to your database table. The easiest way to link forms is to design or "build" a form with design tools. With design tools it is easy to link a form field to existing fields or, if you prefer, external fields. Once compiled, your new form will automatically link data to the appropriate fields.

Other People Are Reading

How to Sync an "Access 2007" Table With a Form

1.

How to Link Tables in MS Access 2007

Instructions
o

1
Launch Microsoft Office Access 2007.

o o

2
Click the "Create" tab." Inside the "Forms" section, click "Blank Form."
Sponsored Links

Test Drive Genio Pickup


World Class Commercial Vehicle for Beverages Distribution by Mahindra mahindragenio.com/Pickup-Van

3
Click a field that you want to link to. The simplest way to create a linked form is to build the form fields in reverse.

4
Click and drag the field into your blank form. This creates an automatic link to that form. You have now added a linked form field. Repeat this with other fields to complete your form design.

Read more: How to Link Forms in Access 2007 | eHow.com http://www.ehow.com/how_7448718_forms-access2007.html#ixzz2Pqrna6Fv

Support
Sign in

link to table

Find it myself Ask the community

Get live help Select the product you need help with

Windows

Internet Explorer

Office

Surface

Xbox

Skype

Windows Phone

More products

Defining relationships between tables in a Microsoft Access

database
Article ID: 304466 - View products that this article applies to.

This article was previously published under Q304466 Novice: Requires knowledge of the user interface on single-user computers. This article applies only to a Microsoft Access database (.mdb or .accdb). For a Microsoft Access 2000 version of this article, see 304467. For a Microsoft Access 97 version of this article, see 304468. Expand all | Collapse all

On This Page SUMMARY


This article describes how to define relationships in a Microsoft Access database. It includes the following topics:

What Are Table Relationships Types of Table Relationships o One-To-Many Relationships o Many-To-Many Relationships o One-To-One Relationships

How to Define Relationships Between Tables o How to Define a One-To-Many or One-To-One Relationships o How to Define a Many-To-Many Relationships

Referential Integrity Cascading Updates and Deletes Join Types Back to the top | Give Feedback

MORE INFORMATION 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 public ation, 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.

Types of Table Relationships


A relationship works by matching data in key columns, usually columns with the same name in both tables. In most cases, the relationship matches the primary key from one table, which provides a unique identifier for each row, with an entry in the foreign key in the other table. For example, sales can be associated with the specific titles sold by creating a relationship between the title_id column in the Titles table (the primary key) and the title_id column in the Sales table (the foreign key). There are three types of relationships between tables. The type of relationship that is created depends on how the related columns are defined.

One-To-Many Relationships
A one-to-many relationship is the most common type of relationship. In this type of relationship, a row in table A can have many matching rows in table B, but a row in table B can have only one matching row in table A. For example, the Publishers and Titles tables have a one-to-many relationship: each publisher produces many titles, but each title comes from only one publisher. A one-to-many relationship is created if only one of the related columns is a primary key or has a unique constraint. In Access, the primary key side of a one-to-many relationship is denoted by a key symbol. The foreign key side of a relationship is denoted by an infinity symbol.

Many-To-Many Relationships
In a many-to-many relationship, a row in table A can have many matching rows in table B, and vice versa. You create such a relationship by defining a third table, called a junction table, whose primary key consists of the foreign keys from both table A and table B. For example, the Authors table and the Titles table have a many-to-many relationship that is defined by a one-to-many relationship from each of these tables to the TitleAuthors table. The primary key of the TitleAuthors table is the combination of the au_id column (the authors tables primary key) and the title_id column (the Titles tables primary key).

One-To-One Relationships
In a one-to-one relationship, a row in table A can have no more than one matching row in table B, and vice versa. A one-to-one relationship is created if both of the related columns are primary keys or have unique constraints. This type of relationship is not common because most information related in this way would be all in one table. You might use a one-to-one relationship to: Divide a table with many columns. Isolate part of a table for security reasons. Store data that is short-lived and could be easily deleted by simply deleting the table. Store information that applies only to a subset of the main table. In Access, the primary key side of a one-to-one relationship is denoted by a key symbol. The foreign key side is also denoted by a key symbol.

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.

How to Define a One-To-Many or One-To-One Relationships


To create a one-to-many or a one-to-one relationship, follow these steps: 1. 2. Close any tables that you have open. You cannot create or modify relationships between open tables. In Access 2002 or in Access 2003, follow these steps: a. Press F11 to switch to the Database window. b. On the Tools menu, click Relationships. In Access 2007, click Relationships in the Show/Hide group on the Database Tools tab. If you have not yet defined any relationships in your database, the Show Table dialog box is automatically displayed. If you want to add the tables that you want to relate, but the Show Table dialog box is not displayed, click Show Table on the Relationships menu. Double-click the names of the tables that you want to relate, and then close the Show Table dialog box. To create a relationship between a table and itself, add that table twice. Drag the field that you want to relate from one table to the related field in the other table. To drag multiple fields, press CTRL, click each field, and then drag them. In most cases, you drag the primary key field (which is displayed in bold text) from one table to a similar field (often with the same name) called the foreign key in the other table. The Edit Relationships dialog box is displayed. Ensure that the field names displayed in the two columns are correct. You can change them if necessary.

3. 4. 5.

6.

7. 8.

Set the relationship options if necessary. If you need information about a specific item in the Edit Relationships dialog box, click the question mark button, and then click the item. These options will be explained in detail later in this article. Click Create to create the relationship. Repeat steps 5 through 8 for each pair of tables that you want to relate. When you close the Edit Relationships dialog box, Microsoft Access asks if you want to save the layout. Whether you save the layout or not, the relationships that you create are saved in the database. NOTE: You can create relationships in queries as well as tables. However, referential integrity is not enforced with queries.

How to Define a Many-To-Many Relationships


To create a many-to-many relationship, follow these steps: 1. 2.

3.

Create the two tables that will have a many-to-many relationship. Create a third table, called a junction table, and then add to the junction table new fields with the same definitions as the primary key fields from each of the other two tables. In the junction table, the primary key fields function as foreign keys. You can add other fields to the junction table, just as you can to any other table. In the junction table, set the primary key to include the primary key fields from the other two tables. For example, in an TitleAuthors junction table, the primary key would be made up of the OrderID and ProductID fields. NOTE: To create a primary key, follow these steps: a. Open a table in Design view. b. Select the field or fields that you want to define as the primary key. To select one field, click the row selector for the desired field. To select multiple fields, hold down the CTRL key, and then click the row selector for each field. In Access 2002 or in Access 2003, click Primary Key on the toolbar. In Access 2007, click Primary Key in the Tools group on the Design tab. Note If you want the order of the fields in a multiple-field primary key to be different from the order of those fields in the table, click Indexes on the toolbar to display the Indexes dialog box, and then reorder the field names for the index named PrimaryKey. Define a one-to-many relationship between each of the two primary tables and the junction table.

c.

4.

Referential Integrity

Referential integrity is a system of rules that Microsoft Access uses to ensure that relationships between records in related tables are valid, and that you do not accidentally delete or change related data. You can set referential integrity when all of the following conditions are met: The matching field from the primary table is a primary key or has a unique index. The related fields have the same data type. There are two exceptions. An AutoNumber field can be related to a Number field with a FieldSize property setting of Long Integer, and an AutoNumber field with a FieldSize property setting of Replication ID can be related to a Number field with a FieldSize property setting of Replication ID. Both tables belong to the same Microsoft Access database. If the tables are linked tables, they must be tables in Microsoft Access format, and you must open the database in which they are stored to set referential integrity. Referential integrity cannot be enforced for linked tables from databases in other formats. The following rules apply when you use referential integrity:

You cannot enter a value in the foreign key field of the related table that does not exist in the primary key of the primary table. However, you can enter a Null value in the foreign key, specifying that the records are unrelated. For example, you cannot have an order that is assigned to a customer that does not exist, but you can have an order that is assigned to no one by entering a Null value in the CustomerID field. You cannot delete a record from a primary table if matching records exist in a related table. For example, you cannot delete an employee record from the Employees table if there are orders assigned to the employee in the Orders table. You cannot change a primary key value in the primary table, if that record has related records. For example, you cannot change an employee's ID in the Employees table if there are orders assigned to that employee in the Orders table.

Cascading Updates and Deletes


For relationships in which referential integrity is enforced, you can specify whether you want Microsoft Access to automatically cascade update or cascade delete related records. If you set these options, delete and update operations that would normally be prevented by referential integrity rules are allowed. When you delete records or change primary key values in a primary table, Microsoft Access makes the necessary changes to related tables to preserve referential integrity. If you click to select the Cascade Update Related Fields check box when you define a relationship, any time that you change the primary key of a record in the primary table, Microsoft Access automatically updates the primary key to the new value in all related records. For example, if you change a customer's ID in the Customers table, the CustomerID field in the Orders table is automatically updated for every one of that customer's orders so that the relationship is not broken. Microsoft Access cascades updates without displaying any message. NOTE: If the primary key in the primary table is an AutoNumber field, selecting the Cascade Update Related Fields check box will have no effect, because you cannot change the value in an AutoNumber field. If you select the Cascade Delete Related Records check box when you define a relationship, any time that you delete records in the primary table, Microsoft Access automatically deletes related records in the related table. For example, if you delete a customer record from the Customers table, all the customer's orders are automatically deleted from the Orders table (this includes records in the Order Details table related to the Orders records). When you delete records from a form or datasheet with the Cascade Delete Related Records check box selected, Microsoft Access warns you that related records may also be deleted. However, when you delete records using a delete query, Microsoft Access automatically deletes the records in related tables without displaying a warning.

Join Types
There are three join types, as follows: Option 1 defines an inner join. An inner join is a join where records from two tables are combined in a query's results only if values in the joined

fields meet a specified condition. In a query, the default join is an inner join that selects records only if values in the joined fields match. Option 2 defines a left outer join. A left outer join is a join in which all the records from the left side of the LEFT JOIN operation in the query's SQL statement are added to the query's results, even if there are no matching values in the joined field from the table on the right. Option 3 defines a right outer join. A right outer join is a join in which all the records from the right side of the RIGHT JOIN operation in the query's SQL statement are added to the query's results, even if there are no matching values in the joined field from the table on the left. Back to the top | Give Feedback

Properties
Article ID: 304466 - Last Review: September 17, 2011 - Revision: 7.0 APPLIES TO

Microsoft Office Access 2007 Microsoft Office Access 2003 Microsoft Access 2002 Standard Edition

Keywords:

kbdesign kbdatabase kbhowto KB304466

Back to the top | Give Feedback

Give Feedback

Was this information helpful?


Yes

No

Somewhat

How much effort did you personally put forth to use this article?
Very low

Low

Moderate

High

Very high

Tell us why and what can we do to improve this information

Back to the top

Other Microsoft sites

Windows

Office

Windows Phone

Xbox

Skype

Bing

Microsoft Store

o o o o o o o o o o

Downloads
Download center Windows downloads Office downloads Service Pack downloads Direct X download

Security
Virus and Security solution center Security home page Microsoft Update

o o o o o o o o o o o o o o o o

Download Security Essentials Malware Removal tool

Support
Knowledge Base search Supported Products list Support offerings Product support lifecycle Small and medium business support IT Pro support Developer support

About Microsoft
Microsoft Careers Company news Investor relations Site map

Popular resources
Microsoft Outlook Express Microsoft Fix It downloads Windows keyboard shortcuts Microsoft Visual C library runtime error Windows Installer error: service could not be accessed Windows Installer cleanup utility download How to: Windows XP system restore Windows update error message Microsoft Security Essentials manual update download Inbox Scanpst.exe

United States
2013 Microsoft

Services Agreement Contact Us Terms of Use Trademarks Privacy & Cookies

1.

Computing

Databases
Search

Databases

Database Basics Learning SQL Using Databases



Share Print

See More About:

database tutorials access tutorials microsoft access access reports

Microsoft Access Reports Tutorial


Part 1: Getting Started

More of this Feature In our previous tutorials, youve learned a good deal about Microsoft Access. Together, we created a query, modified the query to make it more complex, and created a data entry form. We've learned the skills necessary to put information into a database and selectively Part 2: Selecting the Data Part 3: Finishing Touches remove the exact information we're seeking. In this tutorial, we're going to go a step further and learn how to create professionally formatted reports automatically from our database information. Returning to our familiar Northwind Company, we're going to design a nicelyformatted listing of employee home telephone numbers for the use of management. Related Resources

The sample images in this tutorial were created using Access 2000. If you're using Access 2010, you may wish to instead read Creating Reports in Microsoft Access 2010. If you need a quick-start on the basics of Access before getting started, take a look at the article "Microsoft Access Fundamentals." Once again, we're going to use the Northwind sample database. Before we get started, open up Microsoft Access and then open the Northwind database. If you need help with this step, please read the article "How to Install the Northwind Sample Database." Ads You Can Do It Todaywww.UFXMarkets.com/Gold-TradingLearn the steps to profit from Gold prices, Sign UP For Free Training. Keyboard Shortcut Macrowww.AutomationAnywhere.com/MacroCreate Powerful & Reliable Keyboard & Mouse Macros. Try it Now! Get New Customers Onlinewww.Google.com/AdWordsAdvertise On Google. Get 2000 INR Advertising Credit When You Sign-Up

Microsoft Access Fundamentals Creating a Query in Microsoft Access Microsoft Access Forms

From Other Guides MS Access Contact Manager Gaining Access

Elsewhere on the Web Access 2000 Tour Access FAQ

1. Choose the Reports menu. Once you've opened Northwind, you'll be presented with the main database menu shown below. Go ahead and click on the "Reports" selection and you'll see a list of the various reports Microsoft included in the sample database. If you'd like, feel free to double-click on a few of these and get a feel for what reports look like and the various types of information that they contain. 2. Create a new report. After you've satisfied your curiosity, go ahead and click on the "New" button and we'll begin the

process of creating a report from scratch.

Create a new report 3. Select the Report Wizard. The next screen that appears will ask you to select the method you wish to use to create the report. We're going to use the Report Wizard which will walk us through the creation process step-by-step. After you've mastered the wizard, you might want to return to this step and explore the flexibility provided by the other creation methods. 4. Choose a table or query. Before leaving this screen, we want to choose the source of data for our report. If you want to retrieve information from a single table, you can select it from the drop-down box below. Alternatively, for more complex reports, we can choose to base our report on the output of a query that we previously designed. For our example, all of the data we need is contained within the Employees table, so choose this table and click on OK.

Select a creation method Next, we'll select exactly which table data to include in the report and learn how to apply formatting to our finished product. Read on! Next page > Selecting the Data > Page 1, 2, 3
Related Articles

Microsoft Access 2010 Reports Tutorial; Creating a Report in Microsoft Acce... Creating a Simple Query in Microsoft Access Microsoft Access Fundamentals Create a Microsoft Access Database Using a Template Create a Microsoft Access Database Using a Template

Mike Chapple Databases Guide

Sign up for My Newsletter Headlines Forum Free Databases Newsletter!Sign Up Discuss in my forum

Ads Properties in Keralawww.helloaddress.comSearch by location/price/amenities on Kerala's #1 property website. Records Managementwww.packwayslogistics.comSafe Manageable Accurate Reliable Reduce 60% of your cost Better than TallyReachAccountant.comOnline Accounting for your Business Free Trial - Try Now
Advertisement

More Databases Ads

Access Tutorial Web Designing Tutorial Simple Database Software Learn MS Access Microsoft Access Database Ads Pregnancy Tipsstarthealthystayhealthy.inGet best tips on pregnancy. Stay updated with pregnancy tips. Hard Disk Data Recoverywww.stellarinfo.co.in/DataRecoveryLost your data, Stellar would help Free Consultation (022) 4215 1520 Free Online TutorialsALISON.com/FreeOnlineTutorials400 Free Interactive Multimedia Courses. View Our Courses Online!

Explore Databases
Must Reads

Databases for Beginners SQL Basics Top 10 SQL FAQs Top 5 Things Beginners Need to Know Database Glossary Most Popular Database Normalization Basics

Primary Key SQL Server 2012 Editions Entity-Relationship Diagram First Normal Form See More About: database tutorials access tutorials microsoft access access reports By Category Microsoft Access Learning SQL SQL Server Oracle Security in Databases MySQL Administration Design Development Data Mining Database Training Careers Reviews Certifications Other Databases

Databases
1. 2. 3.

About.com Computing Databases

Advertise on About.com

Our Story News & Events SiteMap All Topics Reprints Help Write for About Careers at About User Agreement Ethics Policy Patent Info. Privacy Policy Your Ad Choices 2013 About.com. All rights reserved.
1. Computing

Databases

Search

Databases Learning SQL

Database Basics Using Databases



Share Print

See More About:

access reports access tutorials database tutorials microsoft access Ads You Can Do It Todaywww.UFXMarkets.com/Gold-TradingLearn the steps to profit from Gold prices, Sign UP For Free Training. Get New Customers Onlinewww.Google.com/AdWordsAdvertise On Google. Get 2000 INR Advertising Credit When You Sign-Up Learn More on SQL Serverwww.sswug.orgAccess Videos, Articles and More. SSWUG Community & vConference

Microsoft Access Reports Tutorial


Part 2: Selecting the Data

More of this Feature Part 1: Getting Started Part 3: Finishing Touches

Related Resources Microsoft Access Fundamentals Creating a Query in Microsoft Access Microsoft Access Forms

From Other Guides MS Access Contact Manager Gaining Access

Elsewhere on the Web Access 2000 Tour

5. Select the fields to include. Use the > button to move over the desired fields. Note that Access FAQ the order you place the fields in the right column determines the default order they will appear in your report. Remember that we're creating an employee telephone directory for our senior management. Let's keep the information contained in it simple -- the first and last name of each employee, their title and their home telephone number. Go ahead and select these fields. When you are satisfied, click the Next button. 6. Select the grouping levels. At this stage, you can select one or more grouping levels to refine the order in which our report data is presented. For example, we may wish to break down our telephone directory by department so that all of the members of each department are listed separately. However, due to the small number of employees in our database, this is not necessary for our report. Go ahead and simply click on the Next button to bypass this step. You may wish to return here later and experiment with grouping levels.

Select the fields to include

Choose the grouping levels

7. Choose your sorting options. In order to make reports useful, we often want to sort our results by one or more attributes. In the case of our telephone directory, the logical choice is to sort by the last name of each employee. Select this attribute from the first drop-down box and then click the Next button to continue.

Choose the sorting options In the next section, we'll put the finishing touches on our report. Read on for more! Next page > Finishing Touches > Page 1, 2, 3
Related Articles

Microsoft Access 2010 Reports Tutorial; Creating a Report in Microsoft Acce... Microsoft Access Reports Tutorial Microsoft Access Reports Tutorial Reporting Quick Reports Tutorial - Page 5/9

Mike Chapple Databases Guide

Sign up for My Newsletter Headlines Forum Free Databases Newsletter!Sign Up Discuss in my forum

Ads Buy Gold & Silver Giftsmintyourmoney.com/GiftAmazing Offer. Buy Gold/Silver Gift Upto Rs.10000 Avail COD Today! EliteMatrimony.comwww.elitematrimony.com/Know_moreExclusive Matchmaking Service From BharatMatrimony for Rich & Affluent HDFC Bank Official Sitewww.hdfcbank.comOffers a Wide Range of Banking Services with Fast Processing.

Advertisement

More Databases Ads

Programming Tutorial Web Designing Tutorial Microsoft Access Database SQL Server Tutorial Access Tutorial Ads Shaadi.com MatrimonialsShaadi.com/Register-Free!The World's #1 Matrimonial Service Join 3 Million Members with Photos! Scanner, PDF, OCR Plug-inwww.websio.comfor all versions of SharePoint, Dynamics CRM and Windows C# Programming Forumwww.daniweb.comFree Help & Discussion with C# Pros & Experts. Register Today!

Explore Databases
Must Reads

Databases for Beginners SQL Basics Top 10 SQL FAQs Top 5 Things Beginners Need to Know Database Glossary Most Popular Database Normalization Basics Primary Key SQL Server 2012 Editions Entity-Relationship Diagram First Normal Form See More About: access reports access tutorials database tutorials microsoft access By Category Microsoft Access Learning SQL SQL Server Oracle Security in Databases MySQL Administration Design Development Data Mining Database Training Careers Reviews Certifications Other Databases

Databases

1. 2. 3.

About.com Computing Databases

Advertise on About.com

Our Story News & Events SiteMap All Topics Reprints Help Write for About Careers at About User Agreement Ethics Policy Patent Info. Privacy Policy Your Ad Choices 2013 About.com. All rights reserved.
1. Computing

Databases
Search

Databases Learning SQL

Database Basics Using Databases



Share Print

See More About:

access tutorials database tutorials microsoft access access reports Ads You Can Do It Todaywww.UFXMarkets.com/Gold-TradingLearn the steps to profit from Gold prices, Sign UP For Free Training. Get New Customers Onlinewww.Google.com/AdWordsAdvertise On Google. Get 2000 INR Advertising Credit When You Sign-Up Properties in Keralawww.helloaddress.comSearch by location/price/amenities on Kerala's #1 property website.

Microsoft Access Reports Tutorial


Part 3: Finishing Touches

More of this Feature Part 1: Getting Started

Part 2: Selecting the Data 8. Choose the formatting options. In the next screen, were presented with some formatting options. Well accept the default tabular layout but lets change the page orientation to landscape to ensure the data fits properly on the page. Once youve completed this, click the Next button to continue. Related Resources

9. Select a report style. The next screen asks you to select a style for your report. Click on the various options and youll see a preview of your report in that style in the left portion of Microsoft Access Fundamentals Creating a Query in Microsoft Access the screen. Well use the Corporate style for this report. Select this option and then click the Microsoft Access Forms Next button to move on.

From Other Guides MS Access Contact Manager Gaining Access

Elsewhere on the Web Access 2000 Tour Access FAQ

Chose Formatting Options

Select a Report Style 10. Add the title. Finally, we need to give the report a title. Access will automatically provide a nicely formatted title at the top of the screen, with the appearance shown in the report style you selected during the previous step. Lets call our report Employee Home Phone List. Make sure that the Preview the report option is selected and click on Finish to see our report!

Adding a Title

Our Finished Product Congratulations, you've successfully created a report in Microsoft Access! The final report you see should appear similar to the one presented above. When you close this report, you'll once again see the main database menu illustrated below. Notice that your report now appears in the list (I've added a red box to the figure below for your viewing convenience, this won't appear on your screen.) In the future, you can simply double-click on the report title and a new report will instantly be generated with upto-date information from your database.

Updated Reports Menu I hope you've enjoyed following along with this tutorial. Be sure to experiment on your own with the various report options and you'll be an expert in no time! Next page > > Page 1, 2, 3
Related Articles

Microsoft Access 2010 Reports Tutorial; Creating a Report in Microsoft Acce... Reporting Microsoft Access Reports Tutorial Microsoft Money Category Report Tutorial - Spending, Income and Budget Cate... How to Create an Account Register Report in Microsoft Money

Mike Chapple Databases Guide

Sign up for My Newsletter Headlines Forum Free Databases Newsletter!Sign Up Discuss in my forum

Ads Pregnancy Tipsstarthealthystayhealthy.inGet best tips on pregnancy. Stay updated with pregnancy tips. Zero Account Opening*www.icicidirect.com/zeroacopeningT&C apply. Online Share Trading Made Easy with ICICIdirect.com. #1 Shopping Cart Softwarewww.iqecommerce.comComplete Shopping Cart Setup Ready-made eCommerce solutions.
Advertisement

More Databases Ads

Access Tutorial SQL Server Tutorial Print Design Tutorial MS Access Microsoft Access Database Ads Test Papers & Solutionswww.MeritNation.com/SamplePapersMath, Phy, Chem, Bio, English, SST CBSE, ICSE Class 5-12, Register Now EliteMatrimony.comwww.elitematrimony.com/Know_moreExclusive Matchmaking Service From BharatMatrimony for Rich & Affluent Buy Gold & Silver Giftsmintyourmoney.com/GiftAmazing Offer. Buy Gold/Silver Gift Upto Rs.10000 Avail COD Today!

Explore Databases
Must Reads

Databases for Beginners SQL Basics Top 10 SQL FAQs Top 5 Things Beginners Need to Know Database Glossary Most Popular Database Normalization Basics

Primary Key SQL Server 2012 Editions Entity-Relationship Diagram First Normal Form See More About: access tutorials database tutorials microsoft access access reports By Category Microsoft Access Learning SQL SQL Server Oracle Security in Databases MySQL Administration Design Development Data Mining Database Training Careers Reviews Certifications Other Databases

Databases
1. 2. 3.

About.com Computing Databases

Advertise on About.com

Our Story News & Events SiteMap All Topics Reprints Help Write for About Careers at About User Agreement Ethics Policy Patent Info. Privacy Policy Your Ad Choices 2013 About.com. All rights reserved.

Install Office Sign in India >

Skip to main content


HOME MY OFFICE PRODUCTS SUPPORT IMAGES TEMPLATES STORE

Database basics
This article provides a brief overview of databases what they are, why you might want to use one, and what the different parts of a database do. The terminology is geared toward Microsoft Office Access 2007 databases, but the concepts apply to all database products.

In this article
What is a database? The parts of an Access database

What is a database?
A database is a tool for collecting and organizing information. Databases can store information about people, products, orders, or anything else. Many databases start as a list in a word-processing program or spreadsheet. As the list grows bigger, redundancies and inconsistencies begin to appear in the data. The data becomes hard to understand in list form, and there are limited ways of searching or pulling subsets of data out for review. Once these problems start to appear, it's a good idea to transfer the data to a database created by a database management system (DBMS), such as Office Access 2007. A computerized database is a container of objects. One database can contain more than one table. For example, an inventory tracking system that uses three tables is not three databases, but one database that contains three tables. Unless it has been specifically designed to use data or code from another source, an

Access database stores its tables in a single file, along with other objects, such as forms, reports, macros, and modules. Databases created in the Access 2007 format have the file extension .accdb, and databases created in earlier Access formats have the file extension .mdb. You can use Access 2007 to create files in earlier file formats (for example, Access 2000 and Access 2002-2003). Using Access, you can: Add new data to a database, such as a new item in an inventory Edit existing data in the database, such as changing the current location of an item Delete information, perhaps if an item is sold or discarded Organize and view the data in different ways Share the data with others via reports, e-mail messages, an intranet , or the Internet
TOP OF PAGE

The parts of an Access database


The following sections are short descriptions of the parts of a typical Access database. To learn more about each part, follow the links in the See Also section of this article. Tables Forms Reports Queries Macros Modules

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.
TOP OF PAGE

Did this article help you?

Yes

No

Not what I was looking for

Applies to:

Access 2007 See Also: Create a form by using the Form tool Create a new database Create a simple report Create a simple select query Create a table Database design basics Database Normalization Basics
View More

Site DirectoryContact UsSubmit FeedbackLegalTrademarksPrivacy and CookiesAccessibility


2013 Microsoft Corporation. All rights reserved.

Access 2007 Tutorial


Access 2007 Forms
Access FORMS are user friendly

en

In the previous lesson, you created an Access Table and entered three records. However, to get the m out of Accest it makes sense to create a data entry FORM. By doing so you are making your database m user friendly. It is easier and quicker to enter data onto a form than it is into a table, not least because have more control over the layout and labelling of your form. In this lesson we will learn how to crea FORM that uses your newly created table as the DATA SOURCE.

Create Access form

There are a number of ways to create an Access form. In this lesson we are going to use the ACCESS FO WIZARD.
1. Select form wizard

Open your database if it is not already open. Click the CREATE tab on the ACCESS RIBBON and then se MORE FORMS from the forms group.

A drop down list of form types appears. You need to select FORM WIZARD from this list.
2. Select table and fields

The Form wizard then opens as the pop up window below.

On the first page of the form wizard we select which table we are going to use as the DATA SOURCE. S there is only one table in this database so far, it should already be selected for us in the TABLES/QUER combo box.

Underneath there is a list of the four fields in your table. You could select each field individually highlighting the field name and clicking the single arrow >. We can, however, select all four just by click the double arrow >>. Once they have been transfered into the right hand box they are selected. We now click NEXT to go to page 2 of the form wizard.
3. Form Layout

This is where we choose the FORM LAYOUT. We are going to leave this on the default setting COLUMNAR. Click NEXT again to move onto page three of the form wizard.
4. Form Style

Here we select a style that from the list box. Preview a style by clicking on its name. This step determines how the form looks aesthetically. Once you have selected a style to your taste, click NEXT ag
5. Form Title

This is the last stage of the wizard. Here we are going to choose the name for our form - lets say FOR We are going to leave the radio button selected for OPEN THE FORM TO ENTER OR VIEW INFORMATION All we need to do now is click FINISH and our form should like something like this:

6. Navigate Records via Access Form

As you can see, the form opens with the first record in your original table displayed. You can navig through each record using the NAVIGATION BUTTON at the bottom left of the form window.

To move to the next record click the right arrow button on the navigation control. To move to the record click the >| button on the navigation control. To move backwards through the recordset use the arrow buttons. You could edit any record from the form, which will update the data in your table. For n though, just try navigating through the three records without changing any data.
7. Create New Record via Access Form

Now that you know how to move through the recordset, lets finish off by adding two more records. To this click the star button on the right of the navigation control. This should bring up a blank record. Add for firstname, BROWN for surname, and 39 for age. Click the star again to bring up a new blank record, enter SUE MOORE 33. When you have finished click x on the form window to close.

This tutorial lesson has shown you how to create an Access Form using the form wizard, and how navigate and add records using Access Forms. There are also other ways to Create an Access Form fr Scratch orCustomize an Access Form, but this is as far as we are going to go in this particular lesson. next lesson in the tutorial is going to be Access 2007 queries.
Start Lesson 4 - Create Access 2007 Queries

Web design by Justin Farrell

Install Office Sign in India >

Skip to main content

HOME MY OFFICE PRODUCTS SUPPORT IMAGES TEMPLATES STORE

Create an Access project


An Access project is an Access file (.adp) that provides a direct, efficient connection to a Microsoft SQL Server database through the OLE DB component architecture. You can connect an Access project to a remote SQL Server database, a local SQL Server database, or a local installation of the SQL Server Desktop engine. Microsoft Office Access 2007 allows you to create new Access project (.adp) files, in addition to working with existing Access projects that you created in earlier versions of Access. This article provides a brief explanation of Access projects, tells you how Access projects work in Office Access 2007, and then tells you how to create a new Access project in Access 2007 or connect an Access project to an existing SQL Server database.

What do you want to do?


Understand Access projects Understand how to work with Access projects in Office Access 2007 Create an Access project Connect an existing Access project to a different SQL Server database

Understand Access projects


Creating an Access project provides several advantages over linking to SQL Server tables or views. For example, in an Access project, you can make design changes to SQL Server objects, such as tables and views, and you can create, edit, and use other SQL Server features, such as database diagrams, stored procedures, and user-defined functions. In contrast, when you link to a SQL Server database, you cannot make design changes to any SQL Server objects, and you can only link to SQL Server tables and views.

For more information about either importing or linking to SQL Server data, click the links in the See Also section. Unlike an Access database, an Access project does not contain any data or data-definition-based objects. Instead, these database objects are stored in the SQL Server database. Working with an Access project is very similar to working with an Access database. The processes of creating forms, reports, data access pages, macros, and modules are virtually the same as that used to create an Access database. After you connect to a SQL Server database, you can view, create, modify, and delete tables, views, stored procedures, user-defined functions, and database diagrams by using the Table Designer, Query Builder, and SQL Text Editor tools in Access. Although the user interface used for working with these database objects in an Access project is different from the user interface used for working with equivalent database objects in an Access database, the Access project user interface is just as user friendly. An Access project also contains many of the same wizards as an Access database, such as the Form Wizard, the Report Wizard, and the Input Mask Wizard. These wizards can help you to quickly create a prototype or simple application, and they can also make it easier to create an advanced application.
TIP

In Access 2010, you can deploy an application by publishing it to Access Services on a

SharePoint Server, and then you and others can use it in a browser. Read an article or try Office 2010!
TOP OF PAGE

Understand how to work with Access projects in Office Access 2007


The process for creating an Access project in Access 2007 is not as obvious as in earlier versions of Access. However, you can still create new Access projects and continue to use your existing ones in Access 2007. There are no file format differences between Access 2007 projects and those created in earlier versions of Access. When you work with Access projects, you can take advantage of many of the new features of Access 2007, such as the Navigation Pane customization tools, the improved form and report design tools, and embedded macros. However, certain new features of Access 2007 are not available in Access projects, such as attachments, multivalued fields, or integration with other programs, such as Microsoft Office Outlook 2007 or Windows SharePoint Services 3.0. In addition, Layout View is not available for designing forms and reports.
TOP OF PAGE

Create an Access project

1.

Click the Microsoft Office Button

, and then click New.

Alternatively, on the Getting Started with Microsoft Office Access page, under New Blank Database, clickBlank Database. 1. Do one of the following: Create an Access project in the default file location Under Blank Database, type a name for the project in the File Name box using the .adp file name extension. -orCreate an Access project in a different file location 1. 2. Under Blank Database, click Browse for a location in which to save your database.

In the File New Database dialog box, browse to the location where you want to save the project, or accept the default location.

3. 4. 1.

Type a file name for the project in the File name box. In the Save as type list, select Microsoft Office Access Projects (*.adp), and then click OK.

Under New Project, click Create. Access prompts you with the following message: Do you want to connect to an existing SQL Server database? If you want to connect to an existing SQL Server database, click Yes and continue with step 4; otherwise, click Noand skip to step 5 to create a new SQL Server database.

2.

Connect to an existing SQL Server database 1. In the Data Link Properties dialog box, enter the required information for the following:

Server name Information needed to log on to the server Database name

2.

Click Test Connection to verify that the settings are correct and that the connection succeeds. If the connection does not succeed, the Microsoft Data Link Error dialog box displays a message describing the problem. Click OK to close the message, check your settings in the Data Link Properties dialog box, and then click Test Connection again. Also, you might need to check with the SQL Server database administrator for the database you are connecting to, to make sure your settings are correct or that the computer is available.

3.

After the Microsoft Data Link dialog box displays the message Test connection succeeded, click OKto close the dialog box, and then click OK to close the Data Link Properties dialog box. Access connects the project to the SQL Server database.

3.

Create a new SQL Server database 1. On the first page of the Microsoft SQL Server Database Wizard, enter the following information:

The SQL Server computer you want to use for this database Your logon information A name for the SQL Server database

NOTE To skip the connection process at this time, click Cancel. Access creates the project, but it is not

connected to a SQL Server database. Before you can do anything with the project, you will need to connect it to a SQL Server database, which you can do by using the steps in the next section. 2. Click Next to continue.

Access attempts to connect to the SQL server computer you specified. If Access cannot connect to the SQL server computer, it displays an error message describing the problem. The SQL server computer name or logon information might be incorrect, or you might not have the necessary permissions to create a database on the SQL Server computer that you specified. You might need to check with the SQL Server database administrator for the database you are creating, to make sure your settings are correct or that the computer is available. 3. After Access successfully connects to the SQL Server computer, the wizard displays the message:The wizard has all the information it needs to create your SQL Server database. ClickFinish to continue. Access creates the SQL Server database and connects it to the project.
TOP OF PAGE

Connect an existing Access project to a different SQL Server database


If you have an existing Access project that is not connected to a SQL Server database, or if you want to change the SQL Server computer or database to which your project is connected, use the following procedure.

1. 2.

Click the Microsoft Office Button

, and then click Open.

In the Open dialog box, select and open the Access project.

A Microsoft Office Access Security Notice dialog box might appear. If you trust the source of the database, click Open to continue. 3. Click the Microsoft Office Button , point to Server, and then click Connection.

The Data Link Properties dialog box appears.

4. In the dialog box, enter the required information for the following:

Server name Information needed to log on to the server Database name 5. Click Test Connection to verify that the settings are correct and that the connection succeeds. If the connection does not succeed, Access displays an error message describing the problem. Click OK to close the message, check your settings in the Data Link Properties dialog box, and then click Test Connectionagain. Also, you might need to check with the SQL Server database administrator for the database you are connecting to, to make sure your settings are correct or that the computer is available. 6. After the Microsoft Data Link dialog box displays the message Test connection succeeded, click OK to close the dialog box, and then click OK to close the Data Link Properties dialog box.

Access connects the project to the SQL Server database you specified.
TOP OF PAGE

Did this article help you?

Yes

No

Not what I was looking for

Applies to: Access 2007 See Also: Create a new database Import or link to SQL Server data SQL Server 2005 Home page

Site DirectoryContact UsSubmit FeedbackLegalTrademarksPrivacy and CookiesAccessibility


2013 Microsoft Corporation. All rights reserved.

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