ASP.NET
  Home arrow ASP.NET arrow Page 9 - The Connection Object
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 
Mobile Linux 
App Generation ROI 
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? 
ASP.NET

The Connection Object
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 19
    2004-09-27

    Table of Contents:
  • The Connection Object
  • Connection State
  • The Cancel Method
  • The Execute Method
  • The Open Method
  • The OpenSchema Method
  • Properties of the Connection Object
  • The ConnectionTimeout Property and More
  • The Mode Property and Provider Property
  • The State Property and Version Property
  • Events of the Connection Object
  • The BeginTransComplete Event
  • The Disconnect Event
  • The RollbackTransComplete Event
  • Collections of the Connection Object

  • 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


    The Connection Object - The Mode Property and Provider Property


    (Page 9 of 15 )

    This property indicates the available permissions for modifying data in a Connection.

    ConnectModeEnum = Connection.Mode
    Connection.Mode = ConnectModeEnum

    The value can be one of the ConnectModeEnum constants:

    • adModeUnknown (default) indicates that permissions cannot be determined, or haven’t been set yet.

    • adModeRead grants read-only permissions.

    • adModeWrite grants write-only permissions.

    • adModeReadWrite grants read/write permissions.

    • adModeRecursive indicates that the adShare permissions should be applied recursively.

    • adModeShareDenyRead prevents other users from opening a connection with read permissions. 
       
    • adModeShareDenyWrite prevents other users from opening a connection with write permissions.

    • adModeShareExclusive prevents other users from opening a connection.

    • adModeShareDenyNone allows users to open a connection with any permissions and ensures that neither read nor write permissions can be denied to other users.

    You can use this property to set or return the provider access permission for the current connection.

    You cannot set this property on open connections, and not all providers support all options.

    The Provider Property

    This property indicates the name of the provider for a Connection object.

    String = Connection.Provider
    Connection.Provider = String

    It also can be set by the contents of the ConnectionString property.

    Note that specifying the provider in more than one place can have unpredictable results. Microsoft doesn’t actually specify what "unpredictable" means in this case, but it’s probably best to set this in only one place. The Provider property must be set before trying to access any provider-specific dynamic properties; otherwise, the default OLE DB Provider for ODBC is assumed.

    If no provider is specified, the default is MSDASQL, the Microsoft OLE DB Provider for ODBC. The providers supplied with MDAC 2.6 are:

    • MSDASQL for ODBC

    • MSIDXS for Index Server (if Index Server is installed)

    • ADSDSOObject for Active Directory Services

    • Microsoft.Jet.OLEDB.4.0 for Microsoft Jet databases, both Access 2000 and earlier version

    • SQLOLEDB for SQL Server

    • MSDAORA for Oracle

    • MSDataShape for the Microsoft Data Shape with hierarchical recordsets(discussed in more detail in Chapter 11)

    • MSDAIPP.DSO.1 for Internet Publishing

    • MSDAOSP for developing simple OLE DB providers that expose data in simple tabular (row/column) format
    • MSPersist for persisting or saving a Recordset to a file or object that supports the standard COM IStream interface (such as ASP’s Request or Response objects or ADO’s Stream object)

    Remember that providers aren’t deleted when a later version is installed, so upgrading to 2.8 will still show the providers from an earlier version.

    The various Provider and ConnectionString options are discussed in more detail under the ConnectionString property, and in Chapter 2. 

    This is from ADO Programmer's Reference, by Dave Sussman (Apress, ISBN 1590593421). Check it out at your favorite bookstore today. Buy this book now.

    More ASP.NET Articles
    More By Apress Publishing


     

    ASP.NET ARTICLES

    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT