ASP.NET
  Home arrow ASP.NET arrow Page 6 - 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 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
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 / 18
    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 OpenSchema Method


    (Page 6 of 15 )

    This method obtains database schema information from the provider.

    Set Recordset = Connection.OpenSchema(Schema, _
                        [Criteria], [SchemaID])

    Parameter

    Type

    Description
    Schema

    SchemaEnum (Long)

    The type of schema query to run

     
    Criteria(Optional)

    Variant

    An array of query constraints for each Schema option (generally the column names and values to filter on)

     

     

    SchemaID(Optional) 

    Variant

    The GUID for a provider-specific schema query not defined by the OLE DB specification

    Each value of SchemaEnum has a specific set of criteria values. This large list is included in Appendix B.

    This method is most useful for obtaining table and procedure names from a data store. For example:

    Set rsTables = objConn.OpenSchema(adSchemaTables)
    While Not rsTables.EOF
       Debug.Print rsTables("TABLE_NAME")
       Debug.Print rsTables("TABLE_TYPE")
       rsTables.MoveNext
    Wend

    The various schemas are examined in detail in Appendix D.

    For multidimensional (OLAP) providers using adSchemaMembers, the restrictions can be either the columns in the members schema or one of the MDTREEOP constants, as defined in Appendix L.

    An alternative method of obtaining schema information is to use the ADOX library, as discussed in Chapter 10.

    The RollbackTrans Method

    This method cancels any changes made during the current transaction and ends the transaction.

    Connection.RollbackTrans

    All changes made since the previous BeginTrans will be cancelled. This affects only the most recently opened transaction, and like CommitTrans, you must resolve lower-level transactions before resolving higher-level ones.

    Also, if the Connection object’s Attributes property is set to adXactCommitAbort, the provider automatically starts a new transaction after a RollbackTrans call.

    Also see the BeginTrans method and the CommitTrans method. 

    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

    - 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...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...





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