Reading and Writing to Files on the Intranet (Page 1 of 5 )
This tutorial will show you how to read data in files on an intranet site, as well as write to files on an intranet site. You will be using the Record and Stream objects with ADO to accomplish these tasks.
Introduction
Record and Stream objects introduced with ADO 2.5 give a great deal of flexibility in accessing the files and folders on the intranet site. The Record Object has been treated in some detail in earlier tutorials and the Stream object was also introduced. The ability of the Record object to create and manipulate folders and files, combined with the ability to write and read files using Stream objects, is what confers this flexibility. The Stream object gives access to the text or binary data in the buffer.
Overview of this tutorial
The tutorial provides examples of reading data in files on the intranet site, as well as writing to files on the intranet which were created using the Record object or otherwise. The data read and written to the files may be of the text or binary types. The code listings in this tutorial were all tested with MS Access 2003, used mainly for accessing the Microsoft Visual Basic Editor. The file manipulations on the web site used the intranet site http://hodentek. ADO 2.8 was used for making the reference to the library as shown in the next section.
Adding a reference to the ADO 2.8 library
The MS Access Application Stream is open in the Visual Basic editor. Go to Tools -->References... as shown in the next picture.

This brings up the References - stream window as shown. Here you use the scroll bar to scroll down and pick ADO 2.8 (msado15.dll). The default may be ADO 2.0. Now you can access all the properties and methods of all the ADO objects, including the Stream object.
Next: Opening the Stream Object >>
More Database Articles
More By Jayaram Krishnaswamy