Solved

SQL timeouts in VB6

Posted on 2002-03-20
3
225 Views
Last Modified: 2010-05-02
Hello,
I want to change the default timeouts for SQL 7.

My choices are:  

1. Change the connection string

2. Change it inside of VB6
I use ADODB connection objects to connect to the database.

I've tried doing a command like gcnn.CommandTimeout = 120, but it always seem to timeout after 30 seconds (the default)

Any ideas?

Malcolm

0
Comment
Question by:mrtrevena
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
trkcorp earned 200 total points
ID: 6884633
Hmmm, strange. The gcnn.CommandTimeout = 120 (I assume this is your connection object) should work for you, are you sure it is in effect when you execute your query?  Try:

dim lTO as long
lTO = gcnn.CommandTimeout

just before you run your query and see that it is really set to 120...
You are aware that a Command object has its own CommandTimeout property and is not affected by the connection's setting?
0
 

Author Comment

by:mrtrevena
ID: 6884658
Hey,
Good call ont he command object timeout.  

That solved the problem!

I was having one of the crap days when you get stuck in lots and lots of meetings and constantly putting out fires.  

Nice to have an annoying problem solved by someone else.

Thanks alot!

Malcolm
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 6884676
You're welcome!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 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

18 Experts available now in Live!

Get 1:1 Help Now