|
A database is a list of items stored somewhere to make
their values easy to access or retrieve. This means that a database can
exist anywhere, including human or non-human memory. A computer database is
a list or a group of lists created as a project. There are various ways and
various types of applications used to create such a list. To make it more
useful, special computer applications are formally developed to help create
and manage computer databases.
|
Microsoft Access is an application used to create
computer databases that can be used on a Microsoft Windows operating
system, on a web site, or on a portable medium.
Various Libraries for
a Database
|
|
Because there are many requirements and many options
for computer databases nowadays, there are also various techniques of
creating a database. Still, by its basic definition, a database is
primarily one or more lists. How the list(s) is (are) created can depend
on various circumstances. To make it possible to create databases, various
libraries have been developed and you use one of these libraries to do a
better job:
Microsoft Access Object Library: Microsoft
Access provides its own mechanism for creating and managing a database. It
provides most of the tools you need to start and complete a database
project. Microsoft Access is also equipped with a library, the Microsoft
Access Object Library that you can use to programmatically create and
manage databases. This library is already available to you so you don't
have to "load" it.
Microsoft Data Access Object: Microsoft Data
Access Object, or DAO, is a library that ships with Microsoft Access and
allows you to create, maintain, and manage databases. It also provides
various means of performing the necessary operations on a database.
Microsoft ActiveX Data Objects:
Microsoft ActiveX Data Objects, also called ADO, is a library that was
developed to allow programmers with other environments to create and
manage Microsoft Access databases. To support this, it provides a driver
that allows these other programming environments to "attach" their
applications to a Microsoft Access database. Like Microsoft Access' own
library, you can use ADO inside of Microsoft Access to fully create and
manage a database.
Microsoft ADOX: Microsoft ActiveX Data Object
Extensions for Data Definition Language and Security, also called ADOX, is
an addition to ADO. Besides many of the ADO operations it can perform, you
can use it for additional assignments such as creating a database.
ADO.NET: ADO.NET is a technique developed by
Microsoft and that is part of the .NET Framework. This technology allows
you to use one or more libraries of the .NET Framework and one or more of
the languages of the .NET Framework to create and manage a database.
Although its name includes ADO, ADO.NET is neither ADO nor a real library,
it is a technique of creating and managing databases. For example, while
ADO contains objects and collections, ADO.NET does not own anything
(because it is not a library; it is only a concept of dealing with
databases).
Win32 API: A library is practically never
complete. To complement those cited above, you can use others. One the
external libraries you can use is called Win32. It belongs to Microsoft
Windows and is already installed with the operating system. Because most
of its functions are written in C, they cannot be directly used in a
Microsoft Access database: you must import them.
Other Libraries: Besides the above libraries,
Microsoft and other companies regularly publish other libraries you can
use to perform some tasks in your Microsoft Access databases.
Additionally, you can also create your own library, or ask someone else to
create libraries for you, using languages such as C, C++, Pascal, etc.
In our lessons, we will use Microsoft Office Access
2010 to create computer-based databases. Probably the easiest technique to
launch Microsoft Access consists of clicking Start -> (All) Programs ->
Microsoft Office -> Microsoft Office Access 2010.
Practical
Learning: Starting Microsoft Access
|
|
Microsoft Access Databases
|
|
There are various types of databases you can use in
Microsoft Access. You can create a database from scratch. You can use some
objects that ship with Microsoft Access 2010 to create a database. You can
open either a database you previously created or one made by someone else.
Visually Creating a Microsoft Access Database
|
|
There are various ways you can create a database. To
visually start a database from scratch, after launching Microsoft Access,
you can click Blank Database. In the right section, accept or change the
name of the database. If you want to create a Microsoft Access 2010
database, either omit or add the .accdb extension. If you want to
create a database that is compatible with previous versions of Microsoft
Access, you must add the extension .mdb.
After specifying the name, to specify a folder of your
choice, under File Name and on the right side of the name of the database,
click the Browse button
.
This would open the File New Database dialog box. You can click the arrow
of the Save In combo box to select a drive such as (A:), (C:), etc. After
selecting the drive, you can either select an existing folder or create a
new folder by clicking the Create New Folder button on the right side of
the Save In combo box. You can also use a directory
on the network as the repository of the new database.
After specifying a drive and a folder, you can click
Create.
Creating a Database Using a Wizard
|
|
Microsoft Access ships with a few sample databases you
can use and customize. To create a database from a template, after
launching Microsoft Access, in the middle section, locate one under
Available Templates:
Click one of the buttons. Access or change the
suggested name of the database, and click Download.
If you have a database you do not need anymore, you
can delete it. To delete a database, in My Documents, in Windows Explorer
or another file management application:
- You can click it to select it and press Delete
- You can right-click it and click Delete
A warning message would be presented to you to confirm
what you want to do.
After you have deleted a database, it doesn't
disappear from the MRU lists of Microsoft Access. This means that, after a
database has been deleted, you may still see it in the left list of the
Microsoft Access interface. If a database has been deleted and you want to
remove it from the MRU lists, open the Registry (Start -> Run: regedit,
Enter) and search (F3) for its name. It may be located in:
HKEY_CURRENT_USER
- Software
- Microsoft
- Office
- 12
- Access
- Settings
Locate the deleted database and delete its key.
Microsoft Visual Basic
Fundamentals
|
|
Most of the time, you can create a good performing
database using only Microsoft Office Access 2010. In some other cases, to
create a more complex database, you would have to write code. To support
this, Microsoft Access ships with, and installs, a programming environment
named Microsoft Visual Basic. This is a variant of the popular Microsoft
Visual Basic with everything you need to write code to complete your
application.
In order to access Microsoft Visual Basic, you must
first create or open a database in Microsoft Access. Then, on the ribbon,
you can click the Database Tools tab. In the Database Tools section, you
can click the Visual Basic button
.
This would open Microsoft Visual Basic:
As an alternative, in the Create tab of the ribbon, in
the Macro & Code section, you can click either the Module or the Visual
Basic button.