This creates a database instance, but what is a database instance? Also, rs is not a variable. How does it perform operations such as rs.update in the program? Open means how to receive data from rs? is to create a data set
This data set should be defined first
dimrs as adodb.recordset
Then you can use
set rs=server.CreateObject(adodb.recordset)
To create an instance of the data set, of course there is no data in the data set at this time
rs.open......
to open a recordset
rs.append or rs.insert to add records
rs.edit to modify records
For added or modified records, you can use
rs.fields(field name)=xxx
to assign
rs.update
Update 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
Let's take an example below:
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 to call the html input box
Copy the 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=37 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=37 align=center bgcolor=#EFEFEF>Is the content public:</td>
<td width=640>
<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>
<td width=640>
<input name=Mail type=text class=input value=<% =mRs(Mail) %>>
</td>
</tr>
<tr>
<td width=118 height=37 align=center bgcolor=#EFEFEF>Message:</td>
<td width=640>
<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-enter class=button>
</td>
</tr>
</form>
</table>