ASP execute method (ADO connection) Parameters

Source: Internet
Author: User

Execute method (ADO connection)

Execute the specified query, SQL statement, stored procedure, or provider-specific text.

Syntax

For command strings not returned by the line:

ConneCtion. Execute comMandtext, recordsaffected, options

For command strings returned in line:

Set recordset = ConneCtion. Execute (CoMmandtext, recordsaffected, options)

Return Value

Returns a recordset object reference.

Parameters

Commandtext string value, including the SQL statement, table name, stored procedure, URL, or provider-specific text to be executed.

Recordsaffected is optional. Long variable, the number of records affected by the operation returned by the provider.

Options is optional. Long value indicates how the provider calculates the commandtext parameter. It can be one or more commandtypeenum or executeoptionenum values.

Description

You can use the execute method of the connection object to execute the query passed to the method in the commandtext parameter of the specified connection. If the commandtext parameter specifies the query returned by rows, any results generated by execution will be stored in the new recordset object. If this command is not a query returned by a row, the provider returns the closed recordset object.

The returned recordset object is always a read-only, forward-only cursor. If you need more recordset objects, you should first create a recordset object with the required attribute settings, then use the open method of the recordset object to perform the query and return the required cursor type.

The content of the commandtext parameter is unique to the provider. It can be a standard SQL syntax or any special command format supported by the provider.

The executecomplete event will be triggered at the end of this operation.

 

Refer:

Commandtimeout attribute

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

Set and return values

Sets or returns a long value, which indicates the number of seconds to wait for command execution. The default value is 30.

Description

Use the commandtimeout attribute of the connection object or command object to cancel the execute method call because of network congestion or delay caused by heavy server load. If the command is not executed within the time interval set by the commandtimeout 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 that the provider and data source for which code is being written support the commandtimeout function.

The commandtimeout setting of the connection object does not affect the commandtimeout setting of the command object in the same connection. That is, the commandtimeout attribute of the command object does not inherit the commandtimeout value of the connection object.

On the connection object, after the connection is enabled, the commandtimeout attribute is read/write.

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.