Database
  Home arrow Database arrow Page 5 - 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

    Free Web 2.0 Code Generator! Generate data entry 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 URL reference
    (Page 5 of 6 )

    It is not necessary to have a record open to open a Stream object. By providing a URL reference the Stream may be opened as shown in the next code listing.

    Private Sub Command0_Click()
    Dim strem As ADODB.stream
    Set strem = New ADODB.stream
    strem.Open "URL=http://hodentek/testing.txt/"
    Debug.Print ("strem.Type: " & strem.State) & vbCrLf
    Debug.Print ("strem.Size: " & strem.Size) & vbCrLf
    Debug.Print ("strem.EOS: " & strem.EOS) & vbCrLf
    Debug.Print ("strem.state: " & strem.State) & vbCrLf
    strem.Close
    End Sub

    The next listing shows the print out from the debug.print statements.

     
    strem.Type: 1
     
    strem.Size: 5271
     
    strem.EOS: False
     
    strem.state: 1

    You may be wondering why in spite of the resource being of type 'text,' ADO returns a value for type= 1. In fact this has appeared in a large number of FAQs and caused confusion. If you open a text directly into Stream (no other object is open except the Stream), Microsoft says (not in small print) that the initial data will be shown as binary! This means that the value for Type=1.

    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 3 hosted by Hostway