In ASP command in a single record, some fields appear empty problem _ Application Tips
Source: Internet
Author: User
Edit_rs_cmd.commandtext = "SELECT * from dbo.usertable WHERE id =?"
The fields that can't be displayed are displayed in SQL.
Edit_rs_cmd.commandtext = "Select *,[fields that cannot be displayed],[fields that cannot be displayed], from dbo.usertable WHERE id =?"
And then find the way
Edit_rs. Fields.item ("Opentime"). Value
Put
Edit_rs. Fields.item (11). The order in which Value ' time resides
But these things are complicated. After the DW is ready, you can use the following method
Set edit_rs_cmd = Server.CreateObject ("Adodb.command")
Edit_rs_cmd. ActiveConnection = mm_conn_string
Edit_rs_cmd. Prepared = True
Edit_rs_cmd.commandtext = "SELECT * from dbo.usertable WHERE id =?"
Edit_rs_cmd. Parameters.Append Edit_rs_cmd. CreateParameter ("param1", 5, 1,-1, Edit_rs__mmcolparam) ' Addoubleset edit_rs = Server.CreateObject ("Adodb.recordset")
Edit_rs.open Edit_rs_cmd, 1,1.
The original method
Set edit_rs_cmd = Server.CreateObject ("Adodb.command")
Edit_rs_cmd. ActiveConnection = mm_conn_string
Edit_rs_cmd. Prepared = True
Edit_rs_cmd.commandtext = "Select *,[trytime],[opentime],[endtime],address,scale,content from dbo.usertable WHERE id =?"
Edit_rs_cmd. Parameters.Append Edit_rs_cmd. CreateParameter ("param1", 5, 1,-1, Edit_rs__mmcolparam) ' addouble
Set edit_rs = Edit_rs_cmd. Execute
The following is nonsense, add in, no one can use, or say command but attribute add error!
Reference
CursorType parameter value
Parameter Value Description
adOpenForwardOnly 0 forward pointer, default value. Only use the MoveNext method or the GetRows method to move the pointer forward one-way, the system resources at least, execution speed is the fastest, but many properties and methods will not be used
adOpenKeyset 1 Keyboard pointers, the recordset can be moved back and forth. When a user modifies the data, other users can immediately display it, but they are prevented from viewing records added and deleted by other users
adOpenDynamic 2 dynamic pointers, the recordset can move back and forth. All changes will be immediately displayed on other clients, powerful, but also consume more system resources
adOpenStatic 3 static pointers, the recordset can be moved back and forth. All modifications will not be displayed on other clients
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