Solved

SQL_QUERY_TIMEOUT - how to set ??

Posted on 1998-09-13
5
1,160 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

744 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

11 Experts available now in Live!

Get 1:1 Help Now