Solved

Connection Problem(VB5.0/MSSQLServer)

Posted on 1998-07-05
1
125 Views
Last Modified: 2010-05-03
We are using VB5.0 with MSSQLServer6.5. I have many forms within my application. I dont want to set up a connection to the database for every form. Can anybody suggest how to have only one connection per session.
0
Comment
Question by:rolee
[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
1 Comment
 
LVL 4

Accepted Solution

by:
yowkee earned 30 total points
ID: 1464992
rolee,

  Just declare your database variable as Public in a BAS module file. Then using this database variable in all your form. And remember to close and release the database when your application end.

----- ' code in BAS module
       ' If you are using DAO
Public db As Database

      ' Or if you are using RDO
Public rd As RDOConnection

------

Regards.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 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