Chapter 21. Working with Other Data Files

IN THIS CHAPTER

Understanding File I/O 323

Opening Files 324

Reading from Files 326

Writing to Files 329

Printing to Files 331

Case Study: Using .ini Files 332

Understanding File I/O

Access supports several different file types for import and export. However, sometimes you encounter a file that doesn’t fit into a pattern that allows you to use the import/export process. For those instances, you may need to use file I/O. The I/O stands for input and output functions. These functions allow you to read and write data directly to a file, one line at a time.

Using VBA, the I/O process works like this:

• Use VBA’s Open function to open a file.

• Use VBA’s Input function to read in a line from the file.

• Use ...

Get Microsoft® Office Access 2007 VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.