Presentation is loading. Please wait.

Presentation is loading. Please wait.

Please use speaker notes for additional information!

Similar presentations


Presentation on theme: "Please use speaker notes for additional information!"— Presentation transcript:

1 Please use speaker notes for additional information!
First - Access 2000 Please use speaker notes for additional information! This slide show will introduce Access 2000 fundamentals.

2 The file name is given as First2000.mdb.
Access 2000 The file name is given as First2000.mdb. First I selected to create a new database which I named First2000.mdb. Please note that I left this and came back so the name is registered under my Access2000 directory which I created. Create is used to create the database.

3 Create table in Design view.
Access 2000 Select: Tables Create table in Design view. Once you have decided to create, this screen comes up. We are going to create a table in Design view. The defaults are what we want: Tables and Create table in Design view.

4 The name of the first field is Idno.
Access 2000 The name of the first field is Idno. The default type is Text and the field size default is 50. Other defaults are shown at the bottom of the image. If you click on the arrow under Data Type you will see the other supported data types. Depending on your choice, the other defaults such as field size will change. It should be noted that I changed Field Size to 5 for this table. This shows the name I have entered in as Field Name and the defaults under Data Type.

5 Access 2000 These are the four columns or fields that are on my table. Notice that NumCr is a Number Data Type and I have selected Integer as the Field Size. Note that I added SName which is Text with a length of 25, Major which is Text with a length of 2 and I am now adding NumCr which I am giving a Data Type of Number. The default is Long Integer. I have changed it to Integer. In fact, NumCr will typically be a two digit field.

6 Access 2000 When I save the table, it comes up and asks for a name. I gave it the name FirstTable2000 which will be the table in the database First2000.

7 Access 2000 When I continued with the save, I was told that no primary key was defined. Access strongly recommends a primary key. It is especially important if you are dealing with multiple tables. I decided to respond Yes to this box because I want to create a primary key.

8 Access 2000 This is the key that was created. Note it is a separate field with the name ID. The AutoNumber type means that numbers will be generated. Whey you answer yes to creating a primary key (see the previous slide), then a field to be used as the Key of the data type AutoNumber is created. The field is named ID. Notice the key beside it. Note the key symbol beside the field.

9 This is the table I just created. To enter data, I double clicked.
Access 2000 This is the table I just created. To enter data, I double clicked. Note that tables you have created are now on the list.

10 Access 2000 Double clicking on the table name in the previous slide, brings you to this data entry point. When I first got to this screen after double clicking on FirstTable2000, the AutoNumber was where the 1 is under ID. When I entered data for this record the ID changed to 1 and AutoNumber appeared for the next record. When I entered the Idno of the second record, the number 2 came in as ID and the AutoNumber moved to the next line.

11 Access 2000 I added seven more records to the table FirstTable2000 in the database First2000.

12 Select Queries and the create options are shown.
Access 2000 Select Queries and the create options are shown. Now I moved to Queries under Objects because I want to create a query. The choices are to Create a query in Design View or Create a query by using wizard. I selected to use the Design View.

13 ADD will show the table in the query window.
Access 2000 ADD will show the table in the query window. When you select to create a query with design view, this is the first choice you are presented with. You want to select ADD to add this table to the query.

14 Access 2000 The selected table appears in the query window - FirstTable Notice the list of columns and fields beneath include the automatic number key created by Access.

15 Click on the View button to see the results of the query.
Access 2000 Click on the View button to see the results of the query. Double click to bring down the field. Fields selected for the query. I selected to see Idno, SName and Major from FirstTable2000 in the query. You select the fields by double clicking on the name in the table shown in the query window. If you change your mind about showing a field but you still want it there to use for criteria checking etc., you can unclick the show. I have a condition for this query. I want to see all records where the major = “CI”. Note that the CI is entered under major in the line for Criteria. If you do not surround the CI in quotes, Access will. The quotes are necessary because you are comparing to a alphanumeric literal.

16 Access 2000 In the last record, I clicked the View button and the results of the query are shown. Click on the design button to go back and see the query specifications. Since I only asked for three columns/fields in the query, only three column/fields are shown. In addition, the query had a criteria of Major = "CI". As you can see, all records have CI under major. As shown on the bottom, 6 appear in these query results. There were 9 records in the table.

17 Access 2000 The criteria for this query are in an AND relationship which means that both criteria must be true for the record/row to appear in the query results. In this example, there are two criteria on the same line. Because they are on the same line, these records are in the AND relationship. That means, the query will only show records where the Major = “CI” and the NumCr > 12. Notice that 12 is a numeric literal and is not enclosed in quotes.

18 Access 2000 CI but not > 12. The other non selected records have BU. Some also have > 12. The results of the AND query from the previous slide. These are the 4 records that met the query criteria of major = “CI” and NumCr > 12. All of the records are shown above for verification.

19 Access 2000 Major = CI N Y Record/row NOT selected NumCr > 12 N Y
Record/row selected AND means both criteria must be true for the record/row to be selected. If either criteria receives a NO or false, the record/row will not be selected. This shows the logic for the AND query illustrated on the previous slides.

20 With OR criteria, the criteria are not on the same line.
Access 2000 In this case, I want everyone with a major = "BU" OR NumCr > 12. This is the standard OR relationship. Note that in Access, the OR relationship takes two lines. It uses the or: below the Criteria:. With OR criteria, the criteria are not on the same line.

21 Therefore not selected.
Access 2000 Not BU Not > 12 Therefore not selected. Notice that 7 records met the criteria of either being BU or having number of credits > 12. Two records did not meet the criteria. They have CI and 12, therefore not meeting either criteria.

22 Access 2000 Major = CI N Y NumCr > 12 Record/row selected N Y
Record/row NOT selected Record/row selected OR means you essentially have multiple chances. When there are two conditions in the OR relationship you have two chances. If either one is true than the query criteria is met and the record/row is selected. This shows the logic for the OR query illustrated on the previous slides.

23 Access 2000 In order by key - ID.
I have added 5 more rows/records to the table. Notice they are in order by the key which is the ID with the AutoNumber. In order by key - ID.

24 Access 2000 Note that I also put Ascending after Sort in the Idno field. The results will be sorted in ascending order by Idno. Note that in most languages, this would be written as: NumCr < 12 AND (Major = "CI" OR Major = "BU") In other words, number of credits has to be less than 12 AND the major can be either CI OR BU. In Access, the conditions must be expressed as: Major = "CI" AND NumCr < 12 OR Major = "BU" AND NumCr < 12. Sort can be Ascending or Descending. There is also a not sorted option if you need to eliminate the sort. This query wants all people who have NumCr less than 12 AND are either CI majors OR BU majors. With Access, you have to set up the criteria as CI AND < 12 OR BU AND < 12.

25 Access 2000 Five records met the criteria of number of records less than 12 and (major = CI or major = BU) Note that all records have NumCr < 12 and a major of either CI or BU. Note also that the results are in order by Idno because of the ascending sort.

26 This shows the logic of the AND/OR illustrated on the previous slides.
Access 2000 This shows the logic of the AND/OR illustrated on the previous slides. NumCr < 12 N Y Record/row NOT selected Major = CI N Y Major = BU Record/row selected N Y Record/row NOT selected Record/row selected This slide shows NumCr < 12 as being required and then the major can be either CI or BU to have the record selected. Remember, Access makes you repeat the < 12 when you write this query in the query designer.

27 Access 2000 These are the three queries discussed on the previous slides. Note that I did not save the original query. Queries can be named or not depending on whether the developer wants to keep them for future use.


Download ppt "Please use speaker notes for additional information!"

Similar presentations


Ads by Google