File Processing

You're probably aware that Access is a database. What is a database? Loosely, it's a collection of data. Do you know that you, too, can build your own database? You can—and you can do it with file I/O (input/output) and a little help from this chapter.

Within VBA there are many techniques for building and managing file I/O routines. File I/O is the approach taken by programmers to manage data stored in files. Data files that you create can be viewed and edited through Microsoft text editors such as Notepad.

Most data files that you work with are built upon a common foundation, much like a database. The data files you learn about in this chapter share the following relationships and building blocks:

• Data File. A collection of data that stores records and fields

• Record. A row of related data that contains one or more fields, separated by a space, tab, or comma

• Field. An attribute in a record, which is the smallest component in a data file

An example data file is shown in Figure 7.8. The trivia.dat data file is used in the chapter-based program. It has five records, with each record containing three fields separated by commas. This is called a comma-delimited file.

0e Edit Farm at Help

0e Edit Farm at Help

1,"What is the capital of Florida?","Tallahassee"

2,"What is the capital of Indiana?" , "Indianapol is" B,"what is the capital of California?"s"Sacramento"

4, "what university is known as the Seminoles?","Florida State University"

5, "What is the first American university to offer a computer science degree'

In the sections to come, I show you how to build and manage your own data files using sequential file access.

0 0

Post a comment