ASP Programming for the Absolute Beginner
.pdf286
ASP Programming for the Absolute Beginner
TRICK |
Access 2000 is a deceptively simple program. Don’t let that perceived simplicity |
|
|
|
convince you that it is not a robust, powerful member of the Office 2000 suite. Check |
|
out Microsoft Access 2002 Fast & Easy by Faithe Wempen (Premier Press, Inc.) for a |
|
solid, more complete overview of Access. |
You have learned how to program your Web pages to interact with an Access database— or, more specifically, you’ve learned how to work with ADO and ASP to empower your Web pages with a data source. In reality, you don’t need to know much at all about Access to integrate your databases with your Web pages, but what if you need a refresher in the fundamentals, such as how to create a database from scratch, insert tables, and modify fields? Well, you’ve come to the right place! This short appendix
|
Y |
introduces you to Access essentials. Along the way, you can take a peek at some of the |
|
query-generating tools that are also available in the application. |
|
L |
|
F |
|
Creating an Access Database |
|
M |
|
To begin, take some time here to go through the process of creating a database from scratch:
1. Open Access. You are immediatelyApresented with a dialog box, asking you to either create a new database or open an existing file (see Figure C.1).
2. Select the Blank AccessEDatabase option, and click OK. You are presented with the File New DatabaseTdialog box, asking you to which location you want to save your new database (see Figure C.2).
FIGURE C.1
Determining how to
create your new
Access database.
FIGURE C.2
In this example, I’m saving the database to my C: drive and giving it the name
TestDatabase.
Team-Fly®
FIGURE C.3
Your newly created
Access database.
Congratulations!.
3.Give your database a name (I named my database TestDatabase), and select a location in which to save it.
4.Click the Create button (refer to Figure C.2). After a few seconds, your database is created (see Figure C.3).
You are ready to begin working in your new database. Now I’ll show you some essential functionality of the application by explaining how to create and modify tables and specific fields in those tables.
Creating Tables in Design View
To work with information in your database, you need a place to store that information. This is where tables come into play.
Access tables are powerful repositories of data, allowing you to view your information in a variety of ways—through the use of simple sorting features, not unlike Excel, as well as SQL queries. Creating them is very easy, and I’ll show you how it’s done.
There are three ways to create a table with Access 2000: in Design view, through the use of a wizard, or by entering data. For this example, you will go through the traditional process of table creation in Design view:
1.Double-click the Create Table in Design View option (refer to Figure C.3). The Design view for a new table appears, as shown in Figure C.4.
2.Notice the three column names in Design view: Field Name, Data Type, and Description. As you create specific fields in a table, each of these columns will contain a value. Your cursor should be flashing in the first Field Name position; if it is not, click there now.
3.For this example, you are going to create a table to store information for a personal address book. You will name the first field ID. Type ID in the first field column, and tab across so that your cursor is in the Data Type field (see Figure C.5).
287
A p p e n d i x
C
A c c e s s
E s s en t i a l s
TRICK
It’s a good idea to name the first field ID or Recnum (short for record number) so you have an easily identifiable field that can also be used as a primary key for the table.