Add the editor content to the database
This example show you the how to feed the editor with content from database and add the editor content to the database.
<%
dim conn
dim connstr
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb")
conn.Open connstr
dim content
if request("action")="save" then
TitleField = Request.Form("TitleField")
MessageField = Request.Form("Editor1_HTMLContent")
sql="select TitleField,MessageField from test"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,3
rs.addnew
rs("TitleField") = TitleField
rs("MessageField") = MessageField
rs.update
response.write " Message added"
response.write " "
rs.close
set rs = nothing
else
MySQL="select top 1 * from test order by id DESC"
set rs2=conn.execute(MySQL)
if not rs2.eof then
TitleField = rs2("TitleField")
MessageField = rs2("MessageField")
rs2.close
set rs2=nothing
end if
end if
%>
|