Learn to make a guestbook step by step-add the online message editing function to the guestbook (1)

Source: Internet
Author: User
 
In the first part of chapter 6, we have briefly introduced the attributes and methods provided by the Command object and their functions. To make it easier for you to understand how to add the online message editing function to the guestbook, I will further explain the properties provided by the Command object and the Open function of the Recordset object.
Properties provided by the Command object:
ACTIVECONNECTION: the ActiveConnection attribute can be used to set which Connection channel the Command object depends on to communicate with the database, therefore, this attribute can be directly transferred to a Connection object that has established a Connection with the database or replaced by a database link string. Virtual host
COMMANDTEXT: the CommandText attribute allows three types of data query information, including general SQL statements, database form names, and subroutine names, the data query information is determined by the CommandType attribute.
COMMANDTIMEOUT: sometimes the network condition is poor, resulting in slow network response. At this time, the Execute method of the Command object will cause the server database to fail to respond normally after execution, resulting in stopping the operation, in the waiting state, in this case, we can use the CommandTimeout attribute to set the maximum time allowed to continue execution after the data query (Execute) is executed. The default value of CommandTimeout is 30 seconds.
COMMANDTYPE: you can use the CommandType attribute to specify the types of data query information. See the following table:
Name value
Integer
Function
Adshorttext
1
Specifies the data query information type as an SQL statement.
Adcmdtable
2
Specifies the type of data query information as the database table name.
Adcmdstoredproc
4
Specify the type of data query information as the subroutine name
Adcmdunknown
8
Unknown request information type
PREPARED: If the database connection control (such as ODBC) of the server provides the data query information precompilation function, we can set the Prepared attribute to true, which can speed up database query.

Open functions of the Recordset object:
Rs. Open data table name or SQL command, Connection object, Recordset type, lock type
Parameter 1: If the data table name is specified, the entire data table is opened. If the Select command is specified, the created Recordset object is the result of the data record selected by the Select command.
Parameter 2: input the Connection object of an opened database.
Parameter 3: Recordset type. It contains the following four setting values:
Recordset value
Meaning
AdOpenForwardOnly (= 0)
Read-only, and the current data record can only be moved down
AdOpenStatic (= 3)
Read-only, the current data records can be freely moved

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.