Solved

Connection Problem(VB5.0/MSSQLServer)

Posted on 1998-07-05
1
124 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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 I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

696 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