Database
  Home arrow Database arrow Page 2 - Using ADO Record to Create and Navigate In...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Using ADO Record to Create and Navigate Intranet Files and Folders
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2006-10-04

    Table of Contents:
  • Using ADO Record to Create and Navigate Intranet Files and Folders
  • Creating folders
  • Creating files
  • Adding files to folders
  • Navigating the files and folders
  • Copying files from one folder to another

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using ADO Record to Create and Navigate Intranet Files and Folders - Creating folders


    (Page 2 of 6 )

    The following picture shows the intranet site, the default website which can be accessed by its URL, http://hodentek. You will notice that there is no folder by the name DevHome.

    Add a form in design and add the code you will see below to the click event of the button. You will find the comments added at appropriate places. This code creates a DevHome folder in the intranet site. Sine it is a folder the adCreateCollection enum constant has been used. If the directory exists, it is overwritten. The over writing does not affect the files contained in the folder. This was later verified.

    The options can be added as shown, and in fact the code completion utility helps you in doing so. The open method of the record takes several arguments which are shown in the following picture. After typing in record.open just put an empty space, wait for the drop down to show up and then start typing in the values or picking from ensuing drop-down for each argument.

    record.Open (source[can be an url],
    ActiveConnection,
    Mode,
    CreateOptions,
    Options,
    Username,
    Password)
    
    Option Compare Database
    Private rec As ADODB.Record
    Private rst As ADODB.Recordset
    Private Sub Command0_Click()
    Set rec = New ADODB.Record
    'This adds the DevHome Directory to the Server
    rec.Open "DevHome", "URL=http://hodentek/", , _
    adCreateOverwrite + adCreateCollection
    rec.Close
    'This adds ASPFree folder to the DevHome Folder
    rec.Open "DevHome/ASPFree", "URL=http://hodentek/", , _
    adCreateOverwrite + adCreateCollection
    rec.Close
    'similarly two other folders are added to the DevHome folder
    rec.Open "DevHome/DevShed", "URL=http://hodentek/", , _
    adCreateOverwrite + adCreateCollection
    rec.Close
    rec.Open "DevHome/DevArticles", "URL=http://hodentek/", , _
    adCreateOverwrite + adCreateCollection
    rec.Close
    End Sub
    

    When this code is run you may verify in your default web site that the folder DevHome is created as shown.

    While the first statement creates the DevHome folder, the statements that follow create the other sub-folders as shown. Notice that the ASPFree folder is now empty. Actually the others are also empty as well.

    Since these folders are created in the web site, they actually reside in the root directory of the site. This is shown in the next picture.

    More Database Articles
    More By Jayaram Krishnaswamy


       · This is very important if you are planning to make changes to your web site. I can...
     

    DATABASE ARTICLES

    - Building Applications with Anonymous Types
    - A Closer Look at Anonymous Types
    - Programming with Anonymous Types
    - Converting Your Excel Worksheet into a Worki...
    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek