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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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 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

    - More Advanced ASP.NET 3.5 Functions and Subr...
    - ASP.NET 3.5 Functions and Subroutines
    - Coding an IQ Test with Conditionally Driven ...
    - Developing Conditionally Driven Event Handle...
    - ASP.NET 3.5 Debugging Using Visual Web Devel...
    - Understanding Event Handlers in ASP.NET 3.5
    - Building a Web Form in ASP.NET and PHP: a Co...
    - Inserting Data into a Microsoft SQL 2008 Dat...
    - Creating an ASP.NET Dynamic Web Page Using M...
    - Retrieving Data from Microsoft SQL Server 20...
    - Building ASP.NET Web Forms to Use a MySQL Da...
    - Creating an ASP.NET Database using MS SQL 20...
    - Building an ASP.NET Website Using Include Ta...
    - Create ASP.NET Web Forms to Use a Microsoft ...
    - Editing Web Design Layout in Visual Web Deve...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek