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.