



(4 ratings)
We will not spend a lot of time here in instruction on Access. Rather, you are referred to a one-page summary of database and table creation under Microsoft Access Database Creation or to any number of books and references that provide an overview. Besides, you do not need to know a lot about Access to set up databases and use them effectively.
The following application builds onto the password checking pages that we've used so far in this tutorial. It is quite simple, yet it introduces you to most of the considerations you will face when designing data-driven Web pages. In this example, we will set up a table of accounts against which we can check user accounts and passwords during log on. As we did for invalid passwords, if the user does not enter a valid account and password, they will not be permitted to view the welcome.asp page. So, before we begin the coding, we'll need to create a database and table to contain a set of valid accounts.
For purposes of this tutorial you'll only need to create one database. Any and all tables necessary for future applications can be created in this database. To simplify access to the database, you can place it in the same directory as your Web pages. In this and subsequent lessons we'll assume the existence of a database named Database.mdb. You can name your database whatever you choose.
Within this database you need to create a new table named Accounts. It's always a good idea to name your databases and tables without embedded blank spaces in the names. The structure of this table is shown below. We are using field sizes of 5 just to reduce the amount of typing.
| Field Name | Field Type | Field Size |
|---|---|---|
| Account | Text | 5 |
| Password | Text | 5 |
These specifications are entered when creating a database table in Access. They control the "structure" of the table, i.e., the fields of data that will be maintained in the table. At the same time, as you define each field, you will need to make sure that three other specifications are made. Make sure that "Required" is set to "No," "Allow Zero Length" is set to "Yes," and "Indexed" is set to "No." These specifications appear at the bottom of the field design window. These values indicate that (1) a data value is not required to appear in the field, (2) the field can contain a NULL value, and (3) that the field is not indexed. When you close the design window you will be asked whether you wish to create a "primary key" field. The answer is "No."
The point to be kept in mind is that you are using Access only to create a database and table structure. You will not be using any of the processing features of Access. All considerations related to key fields, indexing, retrieval, updating, and the like are controlled through scripts, not through the Access software. Once you have created a database structure, you can effectively forget about Access.
Once you have created the table structure, open the table in "datasheet" view and insert a few example records. This is done for testing purposes. Later, we will consider how to populate database tables from Web forms. When you are done, you should have created an Accounts table that looks like the following (Enter your own accounts and passwords.):
| Account | Password |
|---|---|
| aaaaa | 11111 |
| bbbbb | 22222 |
| ccccc | 33333 |
20 Random Tutorials from the same category :
Using Application Variables
SQL Access Methods In ASP
Recordset Access Methods
The Recordset Object
Searching for Matching Values
Randomizer for ASP
Reading form variables passed in the URL
Iterating through Collections In ASP
Displaying Server Values In ASP
ASP.NET Tutorial - Making image thumbnails
DISPLAY DATA FROM DATABASE
Counter in ASP
Processing Form Information In ASP
Server Variables In ASP
Text Editors and Software to Write ASP
ASP.NET 2 Special Purpose Folders
String Functions
AIM Profile Screenname Viewer as a component of AIM Profile Designs
GLOBAL.ASA IN ASP
Counting Visitors In ASP













