?
Solved

Connection Problem(VB5.0/MSSQLServer)

Posted on 1998-07-05
1
Medium Priority
?
158 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
1 Comment
 
LVL 4

Accepted Solution

by:
yowkee earned 120 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

Industry Leaders: 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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

839 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