(4 ratings)   
By: msconline.maconstate.edu
Throughout this tutorial we will be working with information stored in databases. For our purposes we will use the Microsoft Access Database as our database management system. It is easy to learn and use and is readily available to most people with a...
Added: 25 June 2008    Views: 869  
PathComputers    Programming    Asp
Keywords: computers   programming   language   asp   database   functions   code   coder   database  
Do you like this tutorial? Now you can support our team to add more :     
 
 
 
At the same time, Access drivers are available on the IIS Web server to perform processing task against Access databases. Plus, it is relatively easy to migrate from Access to "enterprise-level" databases when the need arises.

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.

Accounts Table Structure
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.):

Accounts Table Data
Account Password
aaaaa 11111
bbbbb 22222
ccccc 33333
About the Author :
msconline.maconstate.edu
Creating Databases
Articles and Tutorials Directory by www.learnfobia.com
 Rate this tutorial : Rate 1Rate 2Rate 3Rate 4Rate 5
  |    Add to Favorites
  |    Send to Friend
  |    Print
Comments