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>
<TD width= "118" height= "align=" "Center" bgcolor= "#EFEFEF" > Nickname:</td>
<TD width= "640" >
<input name= "name" type= "text" class= "input" value= "<% =mrs (" name ")%>" >
</td>
</tr>
<tr>
<TD width= "118" height= "align=" "Center" bgcolor= "#EFEFEF" > content is open:</td>
<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>
<TD width= "118" height= "align=" "Center" bgcolor= "#EFEFEF" > Mailbox:</td>
<TD width= "640" >
<input name= "Mail" type= "text" class= "input" value= "<% =mrs (" Mail ")%>" >
</td>
</tr>
<tr>
<TD width= "118" height= "Panax Notoginseng" align= "center" bgcolor= "#EFEFEF" > Message:</td>
<TD width= "640" >
<textarea name= "Info" rows= "9" cols= "class=" button "><% =mrs (" info ")%></textarea>
</td>
</tr>
<tr>
<TD height= "align=" center "bgcolor=" #EFEFEF "width=" 118 "> Reply:</td>
<TD height= "rowspan=" "2" bgcolor= "#EFEFEF" width= "640" >
<textarea name= "Reply" rows= "6" cols= "a" class= "button" ><% =reply%></textarea>
</td>
</tr>
<tr>
<TD height= "bgcolor=" "#EFEFEF" width= "118" ></td>
</tr>
<tr>
<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>