Solved

ado connection

Posted on 2004-04-07
5
315 Views
Last Modified: 2013-11-23
i have a program that is constantly calling back and forth to a database located outside the local internet

each time i connect it take a little while to connect to the database

how do i open a connection to the database and keep it open in periods of inactivity

or any better suggestions
0
Comment
Question by:tpiazza
5 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
what programming language are you using?
0
 
LVL 10

Accepted Solution

by:
Kavar earned 50 total points
Comment Utility
set your connection object to global in scope, set your timeout to something like 120 seconds (anything longer and you may as well reconnect cause the db will probably time you out)
then only open your connection once at program startup, and just Check connection state before reading/writing data
0
 
LVL 16

Expert Comment

by:warturtle
Comment Utility
Hi,

If you're using Visual Basic, then try this :

connectionObject.setTimeout(400) ;   // setting the time to wait, and be connected for about 400 seconds

This should hopefully keep the connection alive in period of inactivity.

Best Regards,

Warturtle
0
 

Author Comment

by:tpiazza
Comment Utility
forgot about this one
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sumHeights2  challenge 7 75
noX challenge 17 76
wordlen challenge 3 46
move one pixel 4 41
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

743 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

14 Experts available now in Live!

Get 1:1 Help Now