This documentation is archived and is not being maintained.

Data Access Functions

Visual Studio .NET 2003

Working with large amounts of data often requires that data be written to or read from a file. Before either operation can take place, however, the file must first be opened. The FileOpen Function lets you create and access files with one of three types of file access:

  • Sequential access (Input, Output, and Append modes) is used for writing text files, such as error logs and reports.
  • Random access (Random mode) is used to read and write data to a file without closing it. Random-access files keep data in records, which makes it easy to locate information quickly.
  • Binary access (Binary mode) is used to read or write to any byte position in a file, such as storing or displaying a bitmap image.

    Do not use the FileOpen function to manipulate files that are usually edited by a specific application, such as Microsoft Office documents or registry files. Doing so will cause file corruption and loss of file integrity.

The following table shows the statements typically used when writing data to and reading it from files.

See Also

File Access Types and Functions | Sequential File Access | Random File Access | Binary File Access