The long-standing question about SQL timeout and expiration has been solved.

Source: Internet
Author: User

Environment: VB6.0 components used: dataenvironment and adodc

 

Haha, the long-lost question about SQL "timeout and expiration" is finally solved.

Changed commandtimeout = 0. Everything is OK!

The following describes the attributes of a time-limited copy:

 

Commandtimeout attribute

Indicates the time to wait before terminating the attempt and generating errors during command execution.

Set and return values

Set or returnLongValue, which indicates the number of seconds to wait for command execution. The default value is 30.

Description

Using the connection object or command objectCommandtimeoutAttribute to allow you to cancel the execute method call due to network congestion or delay caused by heavy server load. IfCommandtimeoutIf the command is not executed within the time interval set for the attribute, an error is generated and ADO cancels the command. If the attribute is set to zero, ADO waits until the command execution is complete. Make sure the provider and data source support for which code is being writtenCommandtimeoutFunction.

ConnectionObjectCommandtimeoutSet to the sameConnectionMediumCommandObjectCommandtimeoutThe setting has no effect, that isCommandObjectCommandtimeoutProperty does not inheritConnectionObjectCommandtimeoutValue.

InConnectionObject, openConnectionAfter,CommandtimeoutThe attribute is read/write.

 

 

Connectiontimeout attribute

Indicates the waiting time for establishing a connection before terminating the attempt and generating an error.

Set and return values

Set or return the time that indicates waiting for the connection to openLong IntegerValue (in seconds ). The default value is 15.

Description

UseConnectiontimeoutAttribute. If the connection goes through moreConnectiontimeoutThe time set on the property will produce an error and ADO will cancel the attempt. If this attribute is set to zero, ADO waits until the connection is opened. Make sure that the provider that is writing code for it supportsConnectiontimeoutFunction.

When the connection is closedConnectiontimeoutThe attribute is read/write, and the attribute is read-only when it is opened.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.