Solved

problem

Posted on 2001-06-06
2
134 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now