Visual Basic recognizes three different types of data files: sequential files (also called text files), random
access files, and binary files (also called unformatted files).
Sequential files are the easiest to work with, since they can be created by a text editor or word processor, or by a
Visual Basic program.
Such files consist of variable-length strings, organized into individual lines of text.
Sequential files can be displayed or printed at the operating system level (outside of Visual Basic), and they
are easily imported into an application program,such as a word processor or spreadsheet program.
In order to access a particular line of text, however, you must start at the beginning of the file and progress
through the file sequentially, until the desired line has been located. This process can be very time-
consuming when searching through a large file.
Random access files are organized into fixed-length records. (A record is a set of related data items, such
as a name, an address and a telephone number. Each data item within a record fills a field).
Any record can be accessed directly by specifying the corresponding record number or record location. Thus, it is not
necessary to read through the entire file in order to access a particular record.
Applications that require direct access to individual records without regard to their order (as, for example, the daily
updating of customer accounts as they are received) will therefore execute much faster with direct rather than
sequential data files.
Finally, binary files store information as a continuous sequences of bytes. Such files appear unintelligible
when printed or displayed on a computer screen, but their contents can be read into or written out of a
computer faster than other file types, particularly sequential files.