I see an example of how to get data in the database but I do not see an example of how to display the data, for instance "Editor1_HTMLContent". Does anyone have a code example?
Thanks
Paul
<% Set conn = Server.CreateObject("ADODB.Connection") connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb") conn.Open connstr ' save the change to the Access Database if request("action")="save" then MessageField = Request.Form("Editor1_HTMLContent") sql="select MessageField from test" set rs=server.createobject("adodb.recordset") rs.open sql,conn,3,3 rs.addnew rs("MessageField") = MessageField rs.update response.write "<font size=5 color=darkred>Message added</font>" response.write "<br>" rs.close set rs = nothing else ' Load the data from Database and populate the data to the editor MySQL="select top 1 * from test order by id DESC" set rs2=conn.execute(MySQL) if not rs2.eof then editor.Text = rs2("MessageField") rs2.close set rs2=nothing end if end if %>
<%
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb")
conn.Open connstr
' save the change to the Access Database
if request("action")="save" then
MessageField = Request.Form("Editor1_HTMLContent")
sql="select MessageField from test"
rs.open sql,conn,3,3
rs.addnew
rs("MessageField") = MessageField
rs.update
response.write "<font size=5 color=darkred>Message added</font>"
response.write "<br>"
rs.close
' Load the data from Database and populate the data to the editor
MySQL="select top 1 * from test order by id DESC"
editor.Text = rs2("MessageField")
rs2.close
%>
I hope it helps. You can also find the code example in the download package. The file name is todatabase.asp.
asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx Web Messenger: http://cutesoft.net/Web-Messenger/default.aspxasp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspxasp wysiwyg html editor: http://cutesoft.net/ASP asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx Live Support: http://cutesoft.net/live-support/default.aspx