Solved

Connection Problem(VB5.0/MSSQLServer)

Posted on 1998-07-05
1
115 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 30 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now