Jump: Search:

Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access 2007/2010 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2010 (32 bit), 2007, 2003, 2002, 2000, and
Visual Basic 6.0!

Also available for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

 

 
Royalty free source code library modules for Microsoft Access, VB6, VBA, OfficeRoyalty free source code library modules for Microsoft Access, VB6, VBA, OfficeVBA and VB6 Source Code Library Download the free trial version of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA
Category: Database : SQL Server
Description: Working with SQL Server database objects

Class: CADOConnODBC

Class to support client/server operations using ADO with any ODBC connection

This class sets up an ADO connection object for any ODBC connection. Use this connection if a native OLE DB driver is not available for your data source.

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the CADOConnODBC class
Attributes Property Returns the Connection attribute flags used to open the connection to the database. For a Connection object, the Attributes property is read/write, and its value can be the sum of any one or more of the XactAttributeEnum values (default is zero).
CommandTimeout Property Sets how long to wait while executing a command before terminating the attempt and generating an error. Use the CommandTimeout property to allow the cancellation of an Execute method call, due to delays from network traffic or heavy server use.
Connection Property Returns a pointer to the local Connection object that was created by this class. A Connection object represents a unique session with a data source. This is the object created and managed by the CADOConnODBC class. This property is read-only. You may use this property to gain access to all of the properties and methods of the ADODB Connection object via an object variable declared from the CADOConnODBC class.
ConnectionTimeout Property Sets how long to wait while establishing a connection before terminating the attempt and generating an error Use the ConnectionTimeout property on a Connection object if delays from network traffic or heavy server use make it necessary to abandon a connection attempt.
ConnectString Property Returns the value of the ConnectString property of the connection. This property is a combination of the values supplied as properties of this class, and additional values supplied after the connection is made. You may get the value of this property if you wish to see the value of the ConnectString as it was supplied to the server. Note that the server may insert additional parameters into the ConnectString after the connection is made.
CursorLocation Property Sets the value of the CursorLocation property of the connection. This property allows you to choose between various cursor libraries accessible to the provider. Usually, you can choose between using a client-side cursor library or one that is located on the server.
Database Property Returns the string containing the name of the ODBC database used to create the connection.
DataSource Property Returns the string containing the name of the server machine used to create the connection.
Driver Property Sets the string containing the ODBC Driver name used to create the connection. The value of this property is dependent on the particular ODBC driver you are using.
IsolationLevel Property Sets the value of the IsolationLevel property of the connection. Use the IsolationLevel property to set the isolation level of a Connection object. The IsolationLevel property is read/write. The setting does not take effect until the next time you call the BeginTrans method. If the level of isolation you request is unavailable, the provider may return the next greater level of isolation.
Mode Property Returns the value of the Mode property of the connection. Use the Mode property to set or return the access permissions in use by the provider on the current connection. You can set the Mode property only when the Connection object is closed.
Password Property Returns the text of the password used to log into the database.
Provider Property Sets the ODBC provider name used to create the connection. The Provider property is read/write when the connection is closed and read-only when it is open. The setting does not take effect until you either open the Connection object or access the Properties collection of the Connection object. For generic ODBC datasources, the value is the default "MSDASQL".
UserID Property Returns the string containing the user name used to log into the server.
BuildConnectString Private Builds up the string used as the ConnectString property of the class, which is the value used to open the connection. The various property settings of this class are constructed into the actual ConnectString which are used to create the connection. This helper procedure handles creating the string.
Class_Initialize Initialize Set initial values to defaults which may be overridden with property settings
Class_Terminate Terminate Release resources used by the class
CloseConnection Method Closes the current connection to the ODBC database and frees up any associated system resources
m_Connection_BeginTransComplete Private The private local ADODB.Connection variable raises connection- related events. This proc simply passes the BeginTransComplete events on to the user of this class. This handling method is called after the associated operation on the Connection object finishes executing. BeginTransComplete is called after the BeginTrans operation.
m_Connection_CommitTransComplete Private The private local ADODB.Connection variable raises connection-related events. This proc simply passes the CommitTransComplete events on to the user of this class. This handling method is called after the associated operation on the Connection object finishes executing. CommitTransComplete is called after the CommitTrans operation.
m_Connection_ConnectComplete Private The private local ADODB.Connection variable raises connection-related events. This proc simply passes the ConnectComplete events on to the user of this class. The ConnectComplete method is called after a connection starts.
m_Connection_Disconnect Private The private local ADODB.Connection variable raises connection-related events. This proc simply passes the Disconnect events on to the user of this class. The Disconnect method is called after a connection ends.
m_Connection_ExecuteComplete Private The private local ADODB.Connection variable raises connection-related events. This proc simply passes the ExecuteComplete events on to the user of this class. This event is raised after a command has finished executing.
m_Connection_InfoMessage Private The private local ADODB.Connection variable raises connection-related events. This proc simply passes the InfoMessage events on to the user of this class. This method is called whenever a ConnectionEvent operation completes successfully and additional information is returned by a provider.
m_Connection_RollbackTransComplete Private The private local ADODB.Connection variable raises connection- related events. This proc simply passes the RollbackTransComplete events on to the user of this class. This handling method is called after the associated operation on the Connection object finishes executing. RollbackTransComplete is called after the RollbackTrans operation.
m_Connection_WillConnect Private The private local ADODB.Connection variable raises connection-related events. This proc simply passes the WillConnect events on to the user of this class. This method is called before a connection starts. The parameters to be used in the pending connection are supplied as input parameters and can be changed before the method returns. This method may return a request that the pending connection be canceled.
m_Connection_WillExecute Private The private local ADODB.Connection variable raises connection-related events. This proc simply passes the WillExecute events on to the user of this class. This method is called just before a pending command executes on this connection and affords the user an opportunity to examine and modify the pending execution parameters. This method may return a request that the pending command be canceled.
OpenConnection Method Opens the ADODB Connection to the specified ODBC database, using the properties of this class to control parameters of the connection. Using the OpenConnection method establishes the physical connection to a data source. After this method successfully completes, the connection is live and you can issue commands against it and process the results.

Overview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources

Feedback

Contact Us  l   Web questions: Webmaster   l   Copyright © FMS, Inc., Vienna, Virginia
Celebrating our 26th Year of Software Excellence