Using ADO Record to Create and Navigate Intranet Files and Folders
(Page 1 of 6 )
ADO's capabilities continue to expand with succeeding versions. The Record object builds on those abilities. This tutorial explores what you can do with files and folders, including creation and copying; moving and deleting is also touched on briefly.
Introduction
The expanded capability of ADO to access folders and files on the web site came with version 2.5. In an earlier article ADO's capability to look into the folder structure on a web site was discussed. The Record object can confer lot more power to the developer than merely exploring the folder/file structure. You can create folders and files. You can also navigate the folder/file structure as well as copy, move and delete objects. This is quite a feat for an object with a very small object model.
This tutorial begins with creating a predetermined folder structure, builds files into one of the folders, and then moves those files to another folder which is created empty. The tutorial also shows how you can navigate the created folder/file structure.
Overview of the objective of this tutorial
The following folder file structure will be created in an intranet site using the ADODB's record object.
- DevHome
- ASPFree
- Test.htm
- Test.xls
- Test.bmp
- Test.aspx
- DevShed
- DevArticles
At first the three empty directories will be created in the DevHome folder. Following this, the ASPFree folder will be populated with the files. The four files in the ASPFree folder will be copied over to the DevShed folder at the conclusion of the tutorial.
Establish a library reference to ADO 2.8
Create an MS Access project, add a form in design, and add a Command button and a text box. For using ADO 2.8 you need to add a reference to the library as shown in the next picture. The details for how to do this can be found in the article titled Connecting to Microsoft Access with ADO. MS Access is being used because of the easy access to Microsoft Visual Basic Editor and for no other reason. Most of the code is being written to the click event of a button.

Next: Creating folders >>
More Database Articles
More By Jayaram Krishnaswamy