[AccessD] Using Connection class

Brad Marks BradM at blackforestltd.com
Tue Jun 1 16:32:14 CDT 2010


Drew,

Looks good.  Thanks for the assistance.

I appreciate it.

Brad

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Tuesday, June 01, 2010 4:24 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Using Connection class

So to use the class I posted in the Friday Puzzler thread:

 

Define a global variable as the connection class:

 

Public ISFEDatabaseConnection as DatabaseConnection

 

Then open it in starting code:

 

Set ISFEDatabaseconnection=New DatabaseConnection.

 

Then wherever you need to use the database connection:

 

Dim cnn as ADODB.Connection

....

ISFEDatabaseConnection.DBConnect cnn

....

 

'Use the database

.......

Cnn.ReleaseISFEDBConnection

Set cnn=nothing

 

And anywhere where you want to know what DB your connecting too:

 

ISFEDatabaseConnection.ISFEDatabaseTypeString

 

Drew


The information contained in this transmission is intended only for the
person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI
Business 
Sensitive material. If you are not the intended recipient, please
contact the sender 
immediately and destroy the material in its entirety, whether electronic
or hard copy. 
You are notified that any review, retransmission, copying, disclosure,
dissemination, 
or other use of, or taking of any action in reliance upon this
information by persons 
or entities other than the intended recipient is prohibited.

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.





More information about the AccessD mailing list