Microsoft Access
  Home arrow Microsoft Access arrow Page 4 - Using ADO`s Record Object with URLs
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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? 
MICROSOFT ACCESS

Using ADO`s Record Object with URLs
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2006-08-08

    Table of Contents:
  • Using ADO`s Record Object with URLs
  • Looking at URLs on the Localhost
  • Creating a Reference to ADO 2.8
  • Exploring the Web Page URL with ADO
  • Exploring the Web Folder URL with ADO
  • Opening the Connection with a Shorter String

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Using ADO`s Record Object with URLs - Exploring the Web Page URL with ADO


    (Page 4 of 6 )

    Type in (or Copy) the following code to the click event of the Command button. Open the file and click the button; you will see the display shown in the next picture. The text formatting was applied in the design mode.

    Private Sub Command0_Click()
    'Opening a Record object given the URL
    Dim con As New ADODB.Connection
    Dim rec As New ADODB.Record
    Dim constr As String
    'ConnectionString from URL.udl file's text
    constr = "Provider=MSDAIPP.DSO; Data Source=http://hodentek/
    TestingService/HelloOra.asmx;" & _ "Bind Flags=0;Mode=Read;Lock Owner='';Url Encoding=10;User ID=jay;" & _ "Password=;Ignore Cached Data=False; Cache Aggressively=False;" & _ "Treat As Offline=False; Mark For Offline=0;" & _ "Protocol Provider={00000000-0000-0000-0000-000000000000};" & _ "Flush WinInet Password Cache=False; User Agent string="";" & _ "Custom Http Headers="";Use Cached DAV lock Token=False;" & _ "Bypass LIS for Invoke command=False;
    Dump XML response form command execution=False;" & _ "Suppress resource columns in command result=False;" & _ "Show thicket files for WEC server=False;
    Redirect WinHttp to XmlHttp=False"
    con.Open constr rec.ActiveConnection = con rec.Open 'All the properties will be stuffed into this string Dim strPearl As String strPearl = "" strPearl = strPearl + "File explored is: http://hodentek/
    TestingService/" & _ "HelloOra.asmx "
    & vbCrLf & vbCrLf strPearl = strPearl + "Record's parent URL is: " & rec.ParentURL & _ vbCrLf & vbCrLf strPearl = strPearl + "Now the Record's State (1 is adStateopen," & _ "0 is adStateClosed, 4 is adStateExecuting) is: " & rec.State &
    vbCrLf & vbCrLf strPearl = strPearl + "Record's Mode is (1 is adModeRead [default]): "
    & _ rec.Mode & vbCrLf & vbCrLf strPearl = strPearl + "Record's RecordType (0 is adSimpleRecord
    (Leaf-node)," & _ "1 is adCollectionRecord (non-Leaf) is: "
    & rec.RecordType & vbCrLf &
    vbCrLf strPearl = strPearl + "Record's Source is: " & rec.Source & vbCrLf & vbCrLf strPearl = strPearl + "Record's Fields(0) item: " & rec.Fields(0) &
    vbCrLf & vbCrLf strPearl = strPearl + "Record's Fields(1) item: " & rec.Fields(1) &
    vbCrLf & vbCrLf strPearl = strPearl + "Record's Fields(2) item: " & rec.Fields(2) &
    vbCrLf & vbCrLf strPearl = strPearl + "Number of properties for this record are : " & _ rec.Properties.Count & vbCrLf & vbCrLf rec.Close strPearl = strPearl + "Now the Record's State (1 is open, 0 is closed)
    is: "
    & _ rec.State & vbCrLf txtFile.SetFocus txtFile.Text = strPearl con.Close End Sub

    Once the connection string is correctly set, the derivation of the properties, or the usage of the methods is quite simple. For most of the properties the enumerated constants are used. The enumerated constants and their values are also shown for some of the properties in the above picture. For example, RecordType=0 means it is a file, whereas RecordType=1 would imply a folder. The properties explored are highlighted in the code shown above. One of the properties which distinguishes a file from a folder is the RecordType. The RecordMode property used with records is very similar to the LockType property used with recordsets. The Fields collection refers to the various parts of the URL using an index as shown in the code. In the above example, rec.Fields(0) is the HelloOra.asmx file. In order to read the content of this field you would require a Stream object.

    More Microsoft Access Articles
    More By Jayaram Krishnaswamy


       · Yes, as this tutorial shows you can dissect the folder / file structure of your...
     

    MICROSOFT ACCESS ARTICLES

    - Linking SQL Express 2005 Tables to MS Access...
    - Working with Access Projects in Access 2007
    - Exploring Access 2007
    - Working with Stored Procedures in an MS Acce...
    - Creating and Using Action Queries
    - Creating Data Access Pages with Charts using...
    - Advanced Ideas using VBA
    - VBA Details
    - Updating Records in MS Access
    - Using ADO`s Record Object with URLs
    - Exporting XML from MS Access 2003
    - Importing XML into MS Access 2003
    - On Using Pass-through Queries in MS Access
    - Distributed Queries in MS Access
    - Configuring a Linked Microsoft Access Server...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway