Visual Basic File Manipulation Tutorials

If you want a program to be able to keep track of information between each time it is run you have to store it somewhere. One of the primary ways to store information is by saving it to a file and then reading it out the next time your program runs. These tutorials show you how to save and read data from files. Use them to save information or to create your own better Notepad program in Visual Basic.

  • Learn how to use the DriveListBox, DirListBox, and FileListBox to interact with the Windows file system from within your own VB6 environment. This VB tutorial teaches you how to create a file browser and viewer from within Visual Basic.
  • Control Break concepts allow you to break apart and display fields from a sorted sequential file. In this Visual Basic tutorial you learn how this can be used to generate your own reports from a database or your own file format. This is especially useful if you don't want to use some other report generator (like Crystal reports).
  • The VB6 File System Object (FSO) allows you to do many things that aren't built into the normal VB commands. With the FSO you can do all sorts of file and folder manipulation, querying, reading, writing, and many many other things.
  • Visual Basic has many built in functions that allow you to manipulate files, directories, and other file system properties. This VB tutorial shows how you can use these functions to manipulate and change Window's file system objects.
  • Random Access files allow you to read from a specified area of the file with out having to read everything before it. This works great if you want to read the 50th record of your data with out reading all 49 records before it. Check out how to do this in this Random Access VB tutorial.
  • If a file doesn't have a standard text format you will need to read and write to it using VB's binary functions. This works well for files such as pictures, zip files, exe's, and other resource files that aren't just text. Learn how to manipulate binary files in this VB6 tutorial.
  • Many times you need to write data from your VB application to a file. This tutorial explains how you can use the Write # and Print # commands to write out your variables into a sequential file.
  • COBOL is a classic programing language that many people have used. Even if you don't ever write any COBOL programs yourself you might very well have to work with data that was produced by a COBOL program written in the past. This VB6 tutorial explains how you can interact with these ancient COBOL files within Visual Basic.
  • Many times you need to read a file that has each field a fixed width. This can be used to keep track of data (like a poor mans database) or if you are reading in a file that a different program printed out.
  • This VB tutorial builds off the last and demonstrates how you can create more advanced PDF files. It teaches you how to create a multi-page document, with page headers, footers, page numbers, shapes, and images.
  • Creating PDF documents in Visual Basic has always been a difficult task. Many times people have to purchase controls to do it for them. Not with this Visual Basic tutorial. PDF documents can be created in a snap using the mjwPDF class. This is the first in a series of tutorials. It covers the creation of a basic PDF document.
  • This tutorial explains in detail how you can open text files in different formats and read them into your Visual Basic program.
  • Sometimes we want to use windows resource files to store our resources. Learn how you can store bitmaps, waves, AVI's, icons, strings, etc. in a Windows resource file and access it from your VB program.
  • Visual Basic stores resource in the forms .frx file. We can do the same things with our custom resources by using property bags.
  • Windows resource files are sometimes a pain to use. Instead we can store resources in binary format in our own custom resource file using only Visual Basic 6. Than to read the resources you do the same in reverse.