Question

ADO 2.7 and a decorator pattern in VB6

Asked by: daffyduck14mil

Hi,

I am trying to utilize a decorator pattern to decorate a ADO Connection and Parameter object. However, in VB6 I cannot implement the connection object. It gives me a message that it is derived from a pure interface.

Does anybody know how you can implement a decorator on any ADO object? Or, does anybody know where to find information that will help me in getting this done?

The decorator pattern is part of a Resource Pool pattern. I'm trying to create a layer that will give my clients a (cached) connection and command objects.

Thanks in advance for the time spend on this.

Grtz.©

D.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-02-06 at 01:25:58ID20875409
Tags

decorator

,

vb6

Topic

VB Database Programming

Participating Experts
4
Points
0
Comments
17

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Decorator design pattern in java
    Hi all how can I implement Decorator design pattern in Java, and where can find stuff on that pattern in JAVA. code and class diagram will be very helpfull. Danny
  2. what is decorator pattern
    what is decorator pattern?can anybody explain breifly with written example?
  3. decorate text
    hi is there a way to decorate text using css? i dont just mean underline and overline. i am looking to add a small black line that flows around the letters of some white text.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: leonstrykerPosted on 2004-02-06 at 04:22:57ID: 10289234

I never seen this used and only skimmed it as a topic in some books.  You should consider adding points to this question as it will falll into the "the question is hard" category.

Leon

 

by: daffyduck14milPosted on 2004-02-06 at 04:58:21ID: 10289384

Leon,

I have increased points to 500, as this is indeed a "hard" question. I haven't seen much use in VB of patterns in general. In fact, I've never seen any implementation of even a simple abstract factory (at least not in somebody elses code). I am just wondering how far I can take VB towards patterns.

Grtz.©

D.

 

by: leonstrykerPosted on 2004-02-06 at 05:43:30ID: 10289614

I wish I could help you and I would match your points if someone gives some really good online examples and/or sources for this.  All I saw with Google are links to books which briefly talk about it.

Leon

 

by: dancebertPosted on 2004-02-06 at 09:20:12ID: 10291498

> VB6 I cannot implement the connection object.

Are you attempting to pass a connection object across a process boundry?  Can't do that.

Have you looked at ADO's built in ability to cache connections?.  I write stateless apps that open a new connection every time the client talks to the database and find the cacheing works great.

 

by: acperkinsPosted on 2004-02-06 at 15:16:07ID: 10295051

For those unfamiliar with Decorator Patterns (including myself), here is one definition from MSDN Magazine:

Design Patterns: Solidify Your C# Application Architecture with Design Patterns
http://msdn.microsoft.com/msdnmag/issues/01/07/patterns/default.aspx

But Leon is right the chances you are going to get a good response in this forum used to questions like "How do I get the record count in a recordset" are quite remote.  But I am prepared to be surprised.

 

by: daffyduck14milPosted on 2004-02-09 at 02:58:35ID: 10308893

Hi,

I am sorry for not responding to this question. It was the weekend and quite honestly, the pub is a far better place to spend it. Anyway, thanks for the responses on this question.

Dancebert, what I am trying to acomplish is different behaveiour on a certain set of operations, and attach some other operations. And yes, in time I want to marshall connection and command objects over the proces boundaries (possibly on different machines). That is, the decorated objects. I haven't actually looked real close at the caching and pooling. I will do that now.

And yes, I am aware that the average level of questions and responses are um, how to put it politically correct, not the most bright. But perhaps we will be surprised... Who knows.

Then, on a sidenote... You can sort of make it work by making a facade class, and change behaveiour on the operation you want. But this approach disrupts old code should you want to implement a resource pool. If there is interests in this, I could post sample code.

Grtz.©

D.

 

by: dancebertPosted on 2004-02-09 at 07:09:50ID: 10310477

It is possible to pass a command object across a process boundry, but it's relatively slow.  It is not possible to pass a connection object that has an active connection across a process boundry.   It is possible to build apps in VB using sophisticated techniques, despite all the seemingly boneheaded parts of the langugage (have you looked at VB's error handling yet?).  I wish you good luck.

 

by: daffyduck14milPosted on 2004-02-09 at 07:17:48ID: 10310554

Lol,

Well, as far as VB's error handling is considered... It's On Error Goto Hell. It's ackward and unpredictable, but given enough time you can make use of it.

As far as the sophisticated stuff goes, I've already got a few app's running that implement a Repository Pattern. I'm just moving up to more complex and generic solutions. And quite honestly, this is the first real "limit" I encouter in VB. That is, VB 6. As far as I'm concerned, can't wait till I move on to .Net.

Now, what about this question. Shall I leave it open for a set amount of time?

Grtz.©

D.

 

by: acperkinsPosted on 2004-02-09 at 07:28:49ID: 10310655

>>Now, what about this question. Shall I leave it open for a set amount of time?<<
By all means keep it open a few more days, just in case.  But I would close it if you do not get any further responses and no later than 21 days.

 

by: daffyduck14milPosted on 2004-03-10 at 00:46:26ID: 10558936

Bingie,

This question is not abandoned by me, rather by the experts all over the world. Seems it's a bit too hard a problem. Think it can be deleted safely.

Grtz.&copy;

D.

 

by: daffyduck14milPosted on 2004-03-10 at 01:11:42ID: 10559039

Bingie,

I have posted a request for deletion question in the community support area. This question will be deleted.

Grtz.&copy;

D.

 

by: dancebertPosted on 2004-03-10 at 08:45:47ID: 10562319

It's not clear to me that the decorator pattern was to work within a process, across a process boundry or both.  daffyduck14mil stated something that I interpreted to mean he wished to use it both within and across a process boundry:

>And yes, in time I want to marshall connection and command
>objects over the proces boundaries

Well, I posted that one cannot marshall an active connection across a process boundry.  So, daffyduck14mil found out that part of what he wants to do is not possible.  According to EE guidelines, 'you can't do that' is a legitimate answer.  

What do ya'll think?





 

by: daffyduck14milPosted on 2004-03-10 at 09:06:14ID: 10562539

Hi,

I still think that this question is not answered. A possible future problem (that has been correctly pointed to) does not deal with the original question. That is the implementation of a decorater pattern on a connection object in VB 6. If we were to accept the comment as an answer, subsequent searches on the subject results in incorrect information.

I am very happy to give points because I did get usefull information, but I don't feel that it is a solution to the problem given. I am sure we can work out something here.

Grtz.&copy;

D.

 

by: LunchyPosted on 2004-03-14 at 07:59:02ID: 10592215

Closed, 500 points refunded.  I PAQed this as an interesting discussion.   I don't think the entire question was addressed by "you can't do that."

daffyduck14mil, you might consider creating a "Points for" question if you received useful information.   Thanks all.

Lunchy
Friendly Neighbourhood Community Support Admin

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...