Visual Basic and Databases.

Authors Avatar

        Introducing Visual Basic and Databases        1-

Visual Basic and Databases

1. Introducing Visual Basic and Databases

Preview

  • In this first chapter, we will do a quick overview of what the course entails.  We will discuss what you need to complete the course.  We’ll take a brief look at what databases are, where they are used, and how Visual Basic is used with databases.  And, we’ll review the Visual Basic development environment and the steps followed to build an application in Visual Basic.


Course Objectives

  • Understand the benefits of using Microsoft Visual Basic to build a ‘front-end’ interface as a database programming tool
  • Learn database structure, terminology, and proper database design
  • Learn how to connect to a database using the Visual Basic DAO (data access object) control
  • Use the ADO (ActiveX data object) data control and data environment to connect to a database (Visual Basic 6 only)
  • Learn the use of Visual Basic data bound controls
  • Learn to make database queries using SQL (structured query language)
  • Understand proper database search techniques
  • Learn how to use the Visual Data Manager to create a database
  • Learn database management techniques
  • Learn to create and produce database reports
  • Learn how to distribute a Visual Basic database application
  • Understand connection to remote databases
  • Introduce other advanced database concepts


Course Requirements

  • An obvious requirement is a Windows-based computer with Windows 95, Windows 98, Windows 2000, Windows Me, Windows NT, or Windows XP installed, as well as Visual Basic.  The student should be familiar with the basics of using the Windows operating system.

  • Visual Basic and Databases requires some edition of Visual Basic 5 or Visual Basic 6.  There are two controls used by Visual Basic to interact with databases:  the DAO (data access object) control and the ADO (ActiveX data object) control.  Both controls will be discussed in this course.  You should be aware, however, that the ADO control is available only with Visual Basic 6

  • Most examples presented in the course notes are done using the Professional Edition of Visual Basic 6.  Hence, if you are using Visual Basic 5 or another edition of Visual Basic 6, some of your screens may differ from the ones seen in the notes.

  • No knowledge of databases or how to work with databases is presumed.  Adequate introductory material is presented.  Even if you’ve worked with databases before, it is suggested you read through this introductory information to become acquainted with the nomenclature used by the author for databases and their component parts.

  • This course does not teach you how to build a Visual Basic application.  It is assumed that the student has a basic understanding of the Visual Basic development environment and knows the steps involved in building a Visual Basic application.  You should feel quite comfortable with building the example application at the end of this first chapter.  If not, our company, KIDware, offers several tutorials that teach this information.  Please visit our web site or contact us for more information.


What is a Database?

  • A database is a collection of information.  This information is stored in a very structured manner.  By exploiting this known structure, we can access and modify the information quickly and correctly.

  • In this information age, databases are everywhere:

  • When you go to the library and look up a book on their computer, you are accessing the library’s book database.
  • When you go on-line and purchase some product, you are accessing the web merchant’s product database.
  • Your friendly bank keeps all your financial records on their database.  When you receive your monthly statement, the bank generates a database report.
  • When you call to make a doctor appointment, the receptionist looks into their database for available times.
  • When you go to your car dealer for repairs, the technician calls up your past work record on the garage database.
  • At the grocery store, when the checker scans each product, the price is found in the store’s database, where inventory control is also performed.
  • When you are watching a baseball game on television and the announcer tells you that “the batter is hitting .328 against left-handed pitchers whose mother was born in Kentucky on a Tuesday morning,” that useless information is pulled from the team’s database (apologies to our foreign readers who don’t understand the American game of baseball!).

  • You can surely think of many more places that databases enter your life.  The idea is that they are everywhere.  And, each database requires some way for a user to interact with the information within.  Such interaction is performed by a database management system (DBMS).  


  • The tasks of a DBMS are really quite simple.  In concept, there are only a few things you can do with a database:

  1. View the data
  2. Find some data of interest
  3. Modify the data
  4. Add some data
  5. Delete some data

There are many commercial database management systems that perform these tasks.  Programs like Access (a Microsoft product) and Oracle are used world-wide.  In this course, we look at using Visual Basic as a DBMS.

  • Examples where you might use Visual Basic as a DBMS:

  • Implementing a new application that requires management of a database
  • Connecting to an existing database
  • Interacting with a database via the internet

  • In a DBMS, the database may be available locally on your (or the user’s) computer, available on a LAN (local area network) shared by multiple users, or only available on a web server via the Internet.  In this course, we spend most of our time looking at local databases, but access with remote databases is addressed.
Join now!

  • We will look at databases in more depth in the next chapter.  You will see that databases have their own vocabulary.  Now, let’s take a look at how Visual Basic fits into the database management system.


Where Does Visual Basic Fit In?

  • For database management, we say our Visual Basic application acts as a front-end to the database.  This means the Visual Basic application provides the interface between the user and the database.  This interface allows the user to tell the database what he or she needs and allows the database to respond to the request ...

This is a preview of the whole essay