You are on page 1of 2

Databases and Database Objects: An Introduction

Introduction
-The term database describes a collection of data organized in a manner that allows access, retrieval, and use of that data.
-Microsoft Access, usually referred to as simply Access, is a database management system.
-A database management system, such as Access, is software that allows you to use a computer to create a database; add, change,
and delete data in the database; ask and answer questions concerning the data in the database; and create forms and reports using
the data in the database.
Starting Ms-Access
1. Click Start>Type Access>Click Ms-Access 2007.

Creating a Database File


1. Start Ms-Access>Click Blank Database>Enter the database name>Create.

Creating a Table
1.Right-Click Table1>Design View.
2. Enter the fieldnames and data types.
3. Click the Close button in the table designer.

Determining Data Types for the Fields


Each field has a data type. This indicates the type of data that can be stored in the
field. Three of the most commonly used data types are:

1. Text

— The field can contain any characters. A maximum number of 255 characters

is allowed in a field whose data type is Text.

2. Number

— The field can contain only numbers. The numbers either can be

positive or negative. Fields are assigned this type so they can be used in arithmetic

operations. Fields that contain numbers but will not be used for arithmetic

operations (such as postal codes) usually are assigned a data type of Text.

StudID
Firstname
Lastname
Course
Year/Section
Address

To Add Records to a Table


1. Double click the table name.

Linking to an Ms-Access Database File


The simplest way to retrieve a data from an Ms-Access database file in Visual C# is to use Database Explorer. Database Explorer
is a database management tool that enables user to access server-based or local-based databases.
1) Create an Ms-Access database file.
2) Start Visual C#
3) Click File>New Projects>Select Windows Forms Application from the Visual Studio installed templates option>Click the Ok
button.
4) Next, click the View menu>Select Database Explorer. This will display the Database Explorer panel on the left portion of your
VB .NET Integrated Development Environment. Alternatively, you can press CTRL+ALT+S.
5)In the Database explorer panel, locate the Add Connections option>Right-click it, then select Add connection…
6)The Add Connection Dialog box will appear. Click the Change… button beside the data source label>Select Microsoft Access
Database File form the data source list box>Click Ok.
7) Click the Browse… button beside the Database file name label then locate and double-click your (Ms-Access database
file).mdb file>Click Ok.
Click the Test Connection button to test if the database connection is working properly.

You might also like