Set rs = server. Createobject ("ADODB. recordset ")

Source: Internet
Author: User

Is to create a dataset
We should first define this dataset
Dim RS as ADODB. recordset
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 at this time.
Rs. Open ......
To open a record set
Rs. append or Rs. insert to add records
Rs. Edit to modify records
You can use
Rs. Fields ("field name") = xxx
To assign values.
Rs. Update
Update the changed value to the database.
When you add a data (RS1) to the database:
Rs. addnew
RS ("RS1") = "added data"
Rs. Update
Rs. Close
Set rs = nothing
Here is 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
// The following is the HTML input box. CopyCode The Code is 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>
<TD width = "118" Height = "37" align = "center" bgcolor = "# efefef"> nickname: </TD>
& Lt; TD width = "640" & gt;
<Input name = "name" type = "text" class = "input" value = "<% = Mrs (" name ") %>">
</TD>
</Tr>
<Tr>
<TD width = "118" Height = "37" align = "center" bgcolor = "# efefef"> whether the content is public: </TD>
& Lt; TD width = "640" & gt;
<Input type = "radio" name = "QQ" value = "1" <% if Mrs ("QQ") = 1 then response. Write "checked" end if %>
Yes
<Input name = "QQ" type = "radio" value = "0" <% if Mrs ("QQ") = 0 then response. Write "checked" end if %>
No </TD>
</Tr>
<Tr>
<TD width = "118" Height = "37" align = "center" bgcolor = "# efefef"> Email: </TD>
& Lt; TD width = "640" & gt;
<Input name = "mail" type = "text" class = "input" value = "<% = Mrs (" mail ") %>">
</TD>
</Tr>
<Tr>
<TD width = "118" Height = "37" align = "center" bgcolor = "# efefef"> message: </TD>
& Lt; TD width = "640" & gt;
<Textarea name = "info" rows = "9" Cols = "57" class = "button"> <% = Mrs ("info") %> </textarea>
</TD>
</Tr>
<Tr>
<TD Height = "25" align = "center" bgcolor = "# efefef" width = "118"> reply: </TD>
<TD Height = "100" rowspan = "2" bgcolor = "# efefef" width = "640">
<Textarea name = "reply" rows = "6" Cols = "50" class = "button"> <% = reply %> </textarea>
</TD>
</Tr>
<Tr>
<TD Height = "70" bgcolor = "# efefef" width = "118"> </TD>
</Tr>
<Tr>
<TD Height = "20" 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 = "re-input" 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.