Solved

Connection Problem(VB5.0/MSSQLServer)

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 55
VBA open file from excel cell 4 36
Excel - Save a copy of work book 13 83
Create Files based on Cell Values in a Range in Excel 12 20
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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

862 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

26 Experts available now in Live!

Get 1:1 Help Now