ASP executes update and returns the number of updated entries.

Source: Internet
Author: User

ASP returns the number of updated entries when operating SQL Server Update. You can put a parameter in the execute method of connection. The call method is conn.exe cute (SQL, I), and the I is recorded.
Number of updated entries, sample code:

Connsqlserverstr = "provider = sqloledb.1; server = 192.168.1.28; uid = test; Pwd = test; database = testdbsqlserver"
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open connsqlserverstr
Id = request ("ID ")
SQL = "Update Test Set Name = 'hello' where id = '" & ID &"'"
Conn.exe cute SQL, I

Response. Write ("the number of updates is:" & I)

Reference link for the connection object execute method is: http://www.w3school.com.cn/ado/met_conn_execute.asp

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.