Category Archive for: Database Programming with Visual Basic

The QueryDef Object: The Queries Definitions

In addition’ to tables, a database can contain query definitions. The queries that are commonly used on !l database can be stored in the database and called by name. All the queries stored in database can be accessed through the QueryDefs object, which is similar to the TableDef object. The QueryDefs object is a collection of QueryDef objects, one for each…

Read More →

Mapping Database

You design databases using special tools and VisualData Manager is one of the simplest. These tools let you examine and modify the structure of the database, and in some cases, enter data. You can also access the structure of a database from within an application through a series of objects. In this section we will develop a utility…

Read More →

Using the Data-Bound Grid Control

The data-bound Grid control is one of the most flexible and powerful Visual Basic controls. If you have Used microsoft Access, you’ll he familiar with this control. The data-bound Grid control looks a lot like the MSFlexGrid control (discussed in chapter 9), with two major differences: It populated automatically from a RecordSet. It has built-in data-entry mechanisms with…

Read More →

Using the Data-Bound ComboBox Control

The ComboBox control is commonly used as a lookup table, as demonstrated in the Data Entry application earlier in this chapter. To populate the list of the data bound CornboBox control, you must set its RowSource property to a Data control, connected to the database and table from which the data will come. The Data Entry application (in…

Read More →

Advanced Data-Bound Controls

In this section, we are going to look at three data-bound controls that are quite different from those we’ve used so far: The data-bound List control The data-bound ComboBox control The data-bound Grid control . . Unlike the other data-bound controls, these controls can display fields from multiple rows. The data-bound List control is similar to the…

Read More →

Attaching Queries to a Database

Before I end this section of the chapter, we must look at the process of specifying queries with SQL statements and attaching them to the database. To get started, follow these steps: Start the Visual Data Manager and open the BIBLlO database. In the Database window, right- click the All Titles query, and from the shortcut menu, select…

Read More →

An Introduction to SQL

SQL, or Structured Query language, is a nearly universal language used for database management. SQL is a declarative language, as-opposed to a procedural language such as Visual Basic. In a declarative language, you specify what you want, not how to do it. You do not need to tell SQL how to access a database; you only need to tell it…

Read More →

Accessing Fields in RecordSets

The data-bound controls can display the fields of the current record in the Record-Set Of a Data control, but you must also be able to access the fields’ values from Within the application. The field values can be accessed via the Fields object of the RecordSet. The following expression: recordset.Fields represents the fields (columns) of the RecordSet.…

Read More →

Entering Data

The Data control is a great tool for browsing tables and editing their contents, but how about entering new information or deleting existing records? These actions require a few lines of code. Nothing extreme, but you can’t rely on the no-code approach of the Data control for data entry. To write data entry applications, you use the following methods:…

Read More →

Validiting Data

You have seen in the first, example of this chapter that the Data control cap also be used for editing records. Database applications, however, should have the means to validate user input before attempting to save data to the database. The Data control provides a few events-and methods that let you validate the input before committing it to the…

Read More →

Back to Top