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
Solved

SQL timeouts in VB6

Posted on 2002-03-20
3
234 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

856 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