Solved

SQL_QUERY_TIMEOUT - how to set ??

Posted on 1998-09-13
5
1,174 Views
Last Modified: 2008-02-26
Hello all!
How can i set up this param ?

    SQL_QUERY_TIMEOUT

i read about it, in the IIS4 Option pack Help Files.
(<local webserver>/iishelp/iis/htm/asp/iiidcfld.htm)

It refers to idc /htx files, which are the old redundant asp files.
It says that this "number of seconds to wait for a SQL statement to execute before canceling the query"

Obviously, the ODBC driver is timing out, and I need to reset the default timeout number for the ODBC driver.
This is the closest thing I have come up with for an answer.

So my problem is now this - how to set this Param in the new asp format?
or how to set it in ANY SQL Query.

or where could i find more information about it?

Thanks for all helpful answers :-)

Jussy
0
Comment
Question by:webcast
  • 3
  • 2
5 Comments
 

Author Comment

by:webcast
ID: 1090024
Edited text of question
0
 

Author Comment

by:webcast
ID: 1090025
Adjusted points to 100
0
 
LVL 1

Accepted Solution

by:
mikkon earned 100 total points
ID: 1090026
The SQL_QUERY_TIMEOUT parameter is obviously IDC/HTX specific, so you can't use it in ASP. However, there are other ways of setting a query timeout.

Set Connection.CommandTimeout to a timeout value in seconds (default is 30). Then use that Connection when operating on recordsets. If you are using Command object instead, you must set its CommandTimeout property.

For more help on the Connection.CommandTimeout property, see .../iishelp/ado/docs/adopro02_2.htm.

0
 

Author Comment

by:webcast
ID: 1090027
Thank you so much, kind sir!

   I've been plagued by this for ... God knows how long!

My mistake - i was using ConnDB.ConnectionTimeout = <time value>
instead of ConnDB.CommandTimeout = <time value>

Last night, i did do this though, and it worked ....


Const      DB_CONNECT_STR = "Data Source=WebCast;User ID=sa;Password=;SQL_QUERY_TIMEOUT=1000"

But it did work once, and once it didn't work .... weird...

anyways, i just had a quick go with your suggesstion, and it was
fine :-)

Obviously, CommandTimeout is for Connection objects, while
ConnectionTimeout is for recordsets - like you noted sorta ?

Above, you said connection.COMMANDTIMEOUT (for record sets) and
command.COMMANDTIMEOUT (for command obj) .. what is the difference? Shout record sets should have been Connection.CONNECTIONTIMEOUT ?

the first part is just the name of the object created ....

Anyways, so if this is long winded and confussed - just thank you for the answer, which was (like always) looking me in the face :-)
0
 
LVL 1

Expert Comment

by:mikkon
ID: 1090028
Connnection.CommandTimeout sets the timeout of a command (for example, an SQL query), but Connection.ConnectionTimeout sets the timeout for the initial connection (username/password handshaking, which takes place BEFORE any SQL queries are executed).

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

785 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