Database
  Home arrow Database arrow Page 4 - ADO`s Stream Object
Iron Speed
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 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
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

ADO`s Stream Object
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2006-09-19

    Table of Contents:
  • ADO`s Stream Object
  • How to open a Stream object using ADO
  • Syntax for opening a Stream
  • Opening a Stream using an open Record Object
  • Opening a Stream using an URL reference
  • Opening a Stream with no argument, Memory Stream

  • 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
     
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    ADO`s Stream Object - Opening a Stream using an open Record Object
    (Page 4 of 6 )

    It is not necessary to open a recordset followed by a record to open the Stream. If you have a record already open you may just open the Stream object using that record. The record contains the Stream whose properties can be found. The following code shows how the default properties are found.

     
    Private Sub Command0_Click()
     
    Dim rec As New ADODB.Record
    rec.Open "testing.txt", "URL=http://hodentek/"
    Debug.Print "rec.Fields(2).Value: " & (rec.Fields(2).Value) & vbCrLf
    Debug.Print "rec.State: "; (rec.State) & vbCrLf
    '-------
    Dim strm As New ADODB.stream'Item() may show index, but use this code
    Set strm = rec.Fields.Item(ADODB.FieldEnum.adDefaultStream).Value
     
    If strm.State = adStateOpen Then
    Debug.Print "-------------------------" & vbCrLf
    Debug.Print "Stream Open" & vbCrLf
    Debug.Print "-------------------------" & vbCrLf
    Debug.Print "strm.State: " & strm.State & vbCrLf
    Debug.Print "strm.Type: " & strm.Type & vbCrLf
    Debug.Print "strm.Size: " & strm.Size & vbCrLf
    End If
    strm.Close
    Debug.Print "Stream Closed"
    Debug.Print "-------------------------" & vbCrLf
     
    Set strm = Nothing
    '--------
    rec.Close
    'MsgBox (rec.State)
    End Sub

    The debug.print statements will give the print out of some of the values that are sought as shown in the next paragraph.

    ------------------------------------
    rec.Fields(2).Value: http://hodentek/testing.txt
    rec.State: 1
    -------------------------
    Stream Open
    -------------------------
    strm.State: 1
    strm.Type: 2
    strm.Size: 5271 [This is a different resource examined]
    Stream Closed
    -------------------------

    More Database Articles
    More By Jayaram Krishnaswamy


       · There will be a follow up article that shows you how to manipulate the web files on...
     

    DATABASE ARTICLES

    - 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
    - ADO`s Stream Object
    - Opening a Record Object Referencing an Open ...
    - Introducing Jasper (SQL Anywhere 10 Beta)
    - Creating a Database Project in VS 2005
    - Manipulating ADO Recordsets




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