Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

problem

Posted on 2001-06-06
2
Medium Priority
?
149 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 200 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
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…
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…

971 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