Set Rs=server. CreateObject ("Adodb.recordset") in Chinese details _ database related

Source: Internet
Author: User
is to set up a dataset
You should define this dataset before
Dim rs As Adodb.recordset
And then you can use
Set Rs=server. CreateObject ("Adodb.recordset")
To create an instance of a dataset, of course there is no data in the dataset
Rs.Open ...
To open a recordset
Rs.append or Rs.insert to add a record
Rs.edit to modify the record
For records that you add or modify, you can use the
Rs.fields ("field name") =xxx
To assign a value
Rs.update
Update the changed values back to the database
When you add a data (RS1) into the database:
Rs.addnew
RS ("rs1") = "added data"
Rs.update
Rs.close
Set rs=nothing
Here's an example:
Set mrs= Server.CreateObject ("Adodb.recordset")
Mrs.open "SELECT * from book", Conn, 1, 3
Mrs.addnew
MRs ("name") = Name
MRs ("mail") = Mail
MRs ("qq") = QQ
MRs ("info") = Info
MRs ("time") = Now ()
Mrs.update
Mrs.close
Set MRs = Nothing
Here is the call to the HTML input box
Copy Code code as follows:

<table border= "0" cellpadding= "0" style= "border-collapse:collapse" width= "100%" >
<form name= "Form1" method= "Post" action= "admin/<% =filename%>?action=reply&id=<% =id%>" >
<tr>
&LT;TD width= "118" height= "align=" "Center" bgcolor= "#EFEFEF" > Nickname:</td>
&LT;TD width= "640" >
<input name= "name" type= "text" class= "input" value= "<% =mrs (" name ")%>" >
</td>
</tr>
<tr>
&LT;TD width= "118" height= "align=" "Center" bgcolor= "#EFEFEF" > content is open:</td>
&LT;TD width= "640" >
<input type= "Radio" name= "QQ" value= "1" <%if mRs ("Qq") =1 then "Response.Write" End checked >
Is
<input name= "QQ" type= "Radio" value= "0" <%if mRs ("Qq") =0 then "Response.Write" End checked >
No </td>
</tr>
<tr>
&LT;TD width= "118" height= "align=" "Center" bgcolor= "#EFEFEF" > Mailbox:</td>
&LT;TD width= "640" >
<input name= "Mail" type= "text" class= "input" value= "<% =mrs (" Mail ")%>" >
</td>
</tr>
<tr>
&LT;TD width= "118" height= "Panax Notoginseng" align= "center" bgcolor= "#EFEFEF" > Message:</td>
&LT;TD width= "640" >
<textarea name= "Info" rows= "9" cols= "class=" button "><% =mrs (" info ")%></textarea>
</td>
</tr>
<tr>
&LT;TD height= "align=" center "bgcolor=" #EFEFEF "width=" 118 "> Reply:</td>
&LT;TD height= "rowspan=" "2" bgcolor= "#EFEFEF" width= "640" >
<textarea name= "Reply" rows= "6" cols= "a" class= "button" ><% =reply%></textarea>
</td>
</tr>
<tr>
&LT;TD height= "bgcolor=" "#EFEFEF" width= "118" ></td>
</tr>
<tr>
&LT;TD height= colspan= "2" align= "center" bgcolor= "#EFEFEF" >
<input name= "Submit1" type= "Submit" id= "Submit" value= "reply message" class= "button" >
<input name= "reset" type= "reset" id= "ReSet4" value= "Reenter" class= "button" >
</td>
</tr>
</form>
</table>

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.