Solved

problem

Posted on 2001-06-06
2
138 Views
Last Modified: 2010-05-03
i have 3 classes, class 1 uses two methods in class 2 and class 3, i nedd class 2 and class 3 to use the connection string class 1 uses instead of creating new ado connection for 2 & 3.

can somone put some sequence for mr to follow please
0
Comment
Question by:ahm11
2 Comments
 
LVL 2

Accepted Solution

by:
agriggs earned 50 total points
ID: 6161062
There are a couple of ways to do this.

1.  Put a standard module in your program.  Put this code in it:

public cnConnection as ADODB.Connection

Then you can set the cnConnection property from Class1, and reuse it in Class2 & Class3.



2.  Add the Connection object as a parameter to all method calls in Class2 and Class3, and pass the existing connection from Class1 to Class2 & Class3 every time you call a method.


I think you probably get the idea about where this is headed.
0
 

Author Comment

by:ahm11
ID: 6165087
ok i used 2 thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question