This documentation is archived and is not being maintained.

Random File Access

Visual Studio .NET 2003

The bytes in random-access files form records of uniform length, each containing one or more fields. A record with one field corresponds to any standard type, such as an integer or fixed-length string. A record with more than one field corresponds to a user-defined type.

In this section you declare, open, edit, and write to a random-access file, using a hypothetical Employee Records database as an example. Each file-access aspect of the example is discussed separately in the topics listed immediately below.

In This Section

Declaring Variables for Random File Access
Discusses creating variables and user-defined types for random access.
Opening Files for Random Access
Explains how to use the FileOpen statement to work on existing files.
Editing Files Opened for Random Access
Explains how to move records from a random file into variables.
Writing Variables to Records
Covers how to write variables back to records after editing their values.

Related Sections

File Access with Visual Basic Run-Time Functions
Covers processing files directly to create, manipulate, and store text and other data.
Accessing Files with FileSystemObject
Discusses creating objects, accessing their properties, and using the appropriate methods.