• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:


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
1 Solution
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.
ahm11Author Commented:
ok i used 2 thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now