Freetutes.com - Free Visual basic Tutorial website on the web

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > VB6 (Beginners Tutorial)

Tutorial Main Page | Previous Page | Contents | Next Page

Sponsored Links

Example - Phone Directory - Creating the Database

 
1. With this example, we begin the development of a simple phone directory. In the directory, we will keep track of names and phone numbers. We’ll be able to edit, add and delete names and numbers from the directory. And, we’ll be able to search the directory for certain names. In this first step, we’ll establish the structure for the database we’ll use. The directory will use a single table, with three fields: Name, Description, and Phone. Name will contain the name of the person or company, Description will contain a descriptive phrase (if desired) of who the person or company is, and Phone will hold the phone number.

2. Start the Data Manager. Use the previously defined steps to establish a new database . Use PhoneList as a Name for your database table. Define the three fields. Each should be a Text data type. Assign a size of 40 to the Name and Description fields, a size of 15 to the Phone field. When all fields have been defined, the screen should look like this:

When done with the field definitions, click Build the Table to save your new table. You will be returned to the Database Tables window.

3. We’re now ready to enter some data in our database. From the Database Tables window, right click the PhoneList table and select Open. The following window will appear:

At this point, add several (at least five - make them up or whatever) records to your database. The steps for each record are: (1) click Add to add a record, (2) fill in the three fields (or, at least the Name and Phone fields), and (3) click Update to save the contents.

You can also Delete records and Find records, if desired. You can move through the records using the scroll bar at the bottom of the screen. When done entering records, click Close to save your work. Select Exit from the Data Manager File menu. Your database has been created.

Tutorial Main Page | Previous Page | Contents | Next Page

 

 

 

   
Home | Link to Us | Partner Links | About Us | Contact Us
Copyright © 2007-2008 Freetutes.com | All Rights Reserved