Using the Connection Object

The next object you will look at is the Connection object. This object allows us to communicate with the database. You can also specify where the information you get is retrieved to (client vs. server), timeouts for connections and response times, and also transactions that occur and where they begin and end. The ConnectionString property is the most important one, next to the actual open or execute method.

The Connection object creates an open connection to your data store. The Connection object allows you to create a connection to the database. It is opening a channel of communication.

Listing 6.3 is an example of how to make a connection to your database

Code Listing 6.3. Connecting to Your Database
 1: Dim cnn ...

Get Sams Teach Yourself Microsoft® Windows® DNA Programming in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.