Solved

problem

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

786 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