?
Solved

VB6 Global Variables being used in classes and forms

Posted on 2007-04-10
2
Medium Priority
?
220 Views
Last Modified: 2012-06-27
I am creating an N-Tier Application in VB6. I have several forms, a module and 10 classes. Each class instantiates a dataaccess class that connects to my Database.

In my module, I have several global variables declared that I use in my classes and forms. Is it OK to use the globes in the classes and the forms, or should I declare the global variables in my form, use them only in the forms, and pass the info in the global’s through my LETS AND GETS that are in the classes?

My code is compiled into a installation package after I create a DLL from the classes and module.
0
Comment
Question by:AmericaFan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
quiklearner earned 500 total points
ID: 18883446
You can use the globals everywhere.  Whether you want to paas stuff through gets and lets depends on if you forsee re-using any of the classes/forms elsewhere,  where you would want to encapsulate the process of setting those values in the form/class itself.  Globals declared in modules will work just fine though.  As long as everything is pretty much built for this application and tied together well, globals will actually work faster as memory doesn't need to be allocated to hold duplicate values, improving both memory and processor usage (slight processor usage improvment related to extra memory allocation and value setting)
0
 

Author Comment

by:AmericaFan
ID: 18888514
Thanks you. That clears up a lot of things that have been bugging me about 3 tier development.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Suggested Courses

762 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