In ASP, when commands are used for a single record, some fields are displayed as null.

Source: Internet
Author: User

Edit_rs_pai.commandtext = "select * From DBO. usertable where id =? "

At this time, you need to put the fields that cannot be displayed in SQL and display them.
Edit_rs_mirror.commandtext = "select *, [fields not displayed], [fields not displayed], from DBO. usertable where id =? "

The method found later

Edit_rs.fields.item ("opentime"). Value

Set
Edit_rs.fields.item (11). Value 'sequence of time

However, these operations are complicated. After DW provides a good formula, you can use the following method:

Set edit_rs_cmd = server. Createobject ("ADODB. Command ")
Edit_rs_assist.activeconnection = mm_conn_string
Edit_rs_pai.prepared = true
Edit_rs_pai.commandtext = "select * From DBO. usertable where id =? "
Edit_rs_pai.parameters.append edit_rs_pai.createparameter ("param1", 5, 1,-1, edit_rs _ mmcolparam) 'addoubleset edit_rs = server. Createobject ("ADODB. recordset ")
Edit_rs.open edit_rs_cmd, 1, 1

Original Method

Set edit_rs_cmd = server. Createobject ("ADODB. Command ")
Edit_rs_assist.activeconnection = mm_conn_string
Edit_rs_pai.prepared = true
Edit_rs_pai.commandtext = "select *, [trytime], [opentime], [endtime], address, scale, content from DBO. usertable where id =? "
Edit_rs_pai.parameters.append edit_rs_pai.createparameter ("param1", 5, 1,-1, edit_rs _ mmcolparam) 'addouble
Set edit_rs = edit_rs_mirror.execute

The following is nonsense. No command can be used or added, but the attribute is incorrectly added!
Reference
Cursortype parameter value
Parameter value description
Adopenforwardonly 0 forward pointer, default value. Only the movenext method or the getrows method can be used to move the pointer one way forward. The minimum amount of system resources is consumed and the execution speed is the fastest. However, many attributes and methods cannot be used.
Adopenkeyset 1 keyboard pointer, record set can be moved before and after. After a user modifies data, other users can immediately display the data, but cannot view records added or deleted by other users.
Adopendynamic 2 dynamic pointer, record set can move before and after. All modifications will be immediately displayed on other clients, with powerful functions, but more system resources are consumed
Adopenstatic 3 static pointer, which can be moved before and after the record set. All modifications are not displayed on other clients

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.