Page

12.6.0- The Connection Object

Created by Brendan Doss.
Last Updated by Brendan Doss.  

PublicCategorized as 12. ASP and Data Store Access.

Not yet tagged
<< 12.5.1- Describing the ConnectionChapter1212.6.1- Creating a Connection to a Database >>

The Connection Object

So now we know what a connection is, it's time to look at the ADO object of the same name. The Connectionobject is what ADO uses to store our information about the data store connection. In fact, it actually represents a unique sessionwith the data store. As we mentioned earlier, this means that we can use asingle Connection object to connect todifferent data stores at different times. This implies that a Connection object can use different providers atdifferent times.

 

Moreover, we can use a number of Connectionobjects to connect to different data stores at the same time (and we can evenhave multiple Connection objects simultaneouslyconnecting to the same data store!). So, for example, we might have anASP page with two Connection objects, called objConn1 and objConn2.One could use the OLE-DB Jet provider to connect to an Access database, whilethe other could use the OLE-DB SQL Server provider to connect to a SQL Serverdatabase.

 

This may seem obvious – but it's an unfortunate truth thatnot all OLE-DB providers support exactly the same functionality. This shouldn'treally be a surprise – after all, we can expect some data store applications tobe more powerful than others.

 

This difference in capability between providers shouldn't bea big problem to you – especially in the early stages of ASP and ADOdevelopment. However, it's something that you should be aware of as you buildyour skills.

<< 12.5.1- Describing the ConnectionChapter1212.6.1- Creating a Connection to a Database >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |