Print Page | Close Window

EASY RTE from and to MDB

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Rich Text Editor (RTE)
Forum Description: Support forum for the Web Wiz Rich Text Editor (RTE).
URL: https://forums.webwiz.net/forum_posts.asp?TID=13101
Printed Date: 28 March 2026 at 9:37am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: EASY RTE from and to MDB
Posted By: pablo_montiel
Subject: EASY RTE from and to MDB
Date Posted: 24 December 2004 at 12:31am
Hi, I need someone, could integrate in the best way, RTE with just only a FIELD in a .mdb file.
It must be very easy for any .asp programmer to modify just a little and give us a working POSTING and EDITING solution of just one field on an access database using RTE.

I hope somebody could do this...



Replies:
Posted By: goofy_DK
Date Posted: 29 December 2004 at 2:55am
Hi Paoblo
 
Did U solve your problem ??
 
/Goofy


Posted By: pablo_montiel
Date Posted: 30 December 2004 at 4:40pm
not yet ! could you help me ??


Posted By: pablo_montiel
Date Posted: 30 December 2004 at 4:42pm
goofy, I hope you could help me with such a simple example !


Posted By: goofy_DK
Date Posted: 31 December 2004 at 12:27am

Before RTE

 

I needed to open a specificic record from my acces file.

I have used the strQueryString3 to pass my record-id from my asp file with then form to the RTE_textarea.asp, where I use the id to find my data from my database file.

 

strQueryString3 = Trim(Request.QueryString("showid"))

%>

<form name="frmAddMessage" method="post" action="edit.asp?action=save&showid=<%=strQueryString 3 %>" onSubmit="document.getElementById('Submit').disabled=true;"& gt;

 

<% ' here is my RTE field inserted

'Change this to the path to your RTE files

Const strPathToRTEFiles = "RTE/"                                      'This needs to hold the path to the RTE files

%>

                        <!-- include the rich text editor -->

                        <!--#include file="RTE/RTE_editor_inc.asp" -->

</p>

</form>

 

 

And the code in the RTE_textarea.asp :

 

Dim strQueryString3

 

strQueryString1 = Request.QueryString("QS1")

strQueryString2 = Request.QueryString("QS2")

strQueryString3 = Request.QueryString("QS3")

 

 

if Request.QueryString("qs3")<>"" then (test if I have some data parsed)

 

then open my table and fetch data

 

 

 

 

and insert into :

 

strEditorContent = "<div style=""text-align: left; font-family: arial,helvetica,sans-serif;"">"&DATA_GOES_HERE&a



Posted By: pablo_montiel
Date Posted: 04 January 2005 at 9:07am
sorry, may be I am a really newbie, but this is just what I have written and doesn´t work:

in RTE_textarea.asp, this is the code:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="includes/RTE_setup.asp" -->
<!--#include file="functions/RTE_functions_common.asp" -->
<%


'Set the response buffer to true as we maybe redirecting
Response.Buffer = True

'Make sure this page is not cached
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"


Dim strQueryString3     'Holds the editors pre-filled content

Dim strQueryString1
Dim strQueryString2
Dim strQueryString3

strQueryString1 = Request.QueryString("QS1")
strQueryString2 = Request.QueryString("QS2")
strQueryString3 = Request.QueryString("QS3")


if Request.QueryString("QS3")<>"" then


'--- Open Database ---'
Set Database = Server.CreateObject("ADODB.connection")
Database.Open "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=" & DataPassword & "; DBQ=" & DataFile

'--- Open set ---'
set Records = Server.CreateObject("ADODB.recordset")
    Records.Open "SELECT * FROM Data ORDER By RecordID DESC",Database, 1, 3

If NOT Records.EOF Then

'--- Setup Variables ---'
   RecordID = Records("RecordID")
   Message = Records("Text")

     strEditorContent = Records("Text")
     
End if

%>
<html>
<head>
<!--#include file="includes/browser_page_encoding_inc.asp" -->


<script language="javascript">
function enableDesignMode() {<%
If RTEenabled = "Gecko" Then Response.Write("     document.desig nMode = 'on'")
%>     }
</script>
<STYLE>
td {border:1px dotted #CCCCCC;}
</STYLE>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="setTimeout('enableDesignMode()', 20);">
<% = strEditorContent %></body>

</html>

/////////////// And in the editEntry.asp I have this other code (edit entry.asp is outside rte folder):

<% AlertBack = True %>
<!-- #INCLUDE FILE="../Includes/Header.asp" -->
<!--#include file="RTE/includes/browser_page_encoding_inc.asp" -->
<!-- #INCLUDE FILE="Admin.asp" -->
<DIV id=content>
<%
'--- Querish Querystring ---'
Dim Requested, DelRecNo
Requested = Request.Querystring("Entry")
Delete = Request.Querystring("Delete")

If (IsNumeric(Requested) = False) OR (Len(Requested) = 0) Then Requested = 0

If Request.Form("Action") <> "Post" Then

'--- Open set ---'
    If (Requested <> 0) AND (Delete <> "True") Then
    Records.Open "SELECT * FROM Data WHERE RecordID=" & Requested,Database, 1, 3
    ElseIf Requested = 0 Then
    Records.Open "SELECT * FROM Data ORDER By RecordID DESC",Database, 1, 3
    Else

    Database.Execute "DELETE FROM Data WHERE RecordID=" & Requested
    Database.Close
    Set Records = Nothing
    Set Database = Nothing
    Response.Redirect(SiteURL & PageName)

    End If

If NOT Records.EOF Then

'--- Setup Variables ---'
   RecordID = Records("RecordID")
   Title = Records("Title")
   Text = Records("Text")
   Category = Records("Category")
   Password = Records("Password")
   strQueryString3 = Trim(Request.QueryString("RecordID"))

End If

Records.Close
%>
<Form Name="frmAddMessage" Method="Post" action="EditEntry2.asp?action=save&showid=<%=strQueryStri ng3%>" onSubmit="document.getElementById('Submit').disabled=true;"& gt;
<input Name="Action" type="hidden" Value="Post">
             <P><span id="Label1">Title : </span><input Name="Title" type="text" value="<%=Replace(Title,"""",""")%>" style="width:80%;" onChange="return setVarChange()"> <a href="?Entry=<%=Requested%>&Delete=True" title="DELETE this entry" onClick="return confirm('Warning! If You Continue Entry #<%=Requested%> Will Be DELETED.')"><img src="<%=SiteURL%>Images/Delete.gif" width="15" height="15" border="0"></a></P>

             <P>Content :<br>
             <table border="0" cellpadding="1" cellspacing="0" width="100%">
                <tr>
                <td class="td01" align="left">

<%
Const strPathToRTEFiles = "RTE/"
%>
<!-- include the rich text editor -->
<!--#include file="RTE/RTE_editor_inc.asp" -->



                </td>
                </tr>

             <tr>
             <td colspan="2">
             </tr>
                </table>
             </P>

             <% If ShowCat <> False Then Response.Write "<P>Category : <input Name=""Category"" type=""text"" value=""" & Category & """ style=""width:10%;"" onChange=""return setVarChange()""></P>"%>

         <% If Legacy <> True Then %>
             <table border="0" cellpadding="0" cellspacing="0" width="30%">
         <tr ><td align="left"><font color="black">
              <acronym title="If you type in a password, your viewers will need to enter it to view the Entry, leaving it blank means everyone can see your entry">Optional<br>Entry Password</acronym></font><br>
           <input name="password" type="password" value="<%=Password%>" maxlength="10" onChange="return setVarChange()"></td>
  &n


Posted By: goofy_DK
Date Posted: 04 January 2005 at 2:27pm
where do you set your
Request.QueryString("QS3") ???
 
and what is the value
 
Can you get data into your rte form


Posted By: pablo_montiel
Date Posted: 04 January 2005 at 5:14pm
Sorry, but I don't really know .asp and the way it works.

With RTE for NON richt text browser, I've retrieved the info and I can EDIT with that pages.

BUT, with the RTE for RT browsers, I couldn't get the data inside the IFRAME, and I don't really know how to do it.

I pasted the info BEFORE and AFTER in EditEntry.asp and the other code into RTE_textarea.asp but I couldn't get it to work.

don't you have a simple simple database, with just one FIELD, working to EDIT the info USING RTE ??

Maybe I am missing sthg... I don't know, could you read my basic code posted before if there is just an END IF missing ?

I appreciate all your help.


Posted By: pablo_montiel
Date Posted: 11 January 2005 at 1:56pm
Please, a little help with my last message !!!


Posted By: WebWiz-Bruce
Date Posted: 11 January 2005 at 4:35pm
That code above is such a mess I can't even workout what you are doing there but it looks way off you are probably best off starting again.

The RTE iframe using the file RTE_textarea.asp needs to display just the text you want in the textarea.

You maybe better of waiting till next week, as I am working on version 3.0 which I hope to complete this week.

Version 3.0 will be much simpler to integrate.

I am writing it so that you would be able to take a normal textarea within a form you already have with what ever content you want in it, then by placing around 3 lines of code in front of the textarea it will be transformed into an RTE textarea keeping whatever content you already have in your textarea.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: djlurch
Date Posted: 17 January 2005 at 10:37am
I just figured out an elegant hack!!!

In the calling page use:
Dim document_text
document_text = "some HTML code"
Session("document_text") = document_text

In RTE_textarea.asp (near the top) use:
strEditorContent = Session("document_text")
Session("document_text") = Null

It has been drilled in to my head that Session variables using classic ASP are evil.  But, using this method the Session variable is created and destroyed in the same page call.  Resetting it to Null should make it scalable (IM0).


Posted By: WebWiz-Bruce
Date Posted: 17 January 2005 at 10:43am
You are quite right you can use that way, the only problem is that cookies need to be enabled on the users browser in order for session variables to work.

Apart from that I use to use the session variable method myself when I first started building the RTE back in 2001.

Back then no-one else any RTE's available which is why I started building my own based on new RTE features in IE at the time, since then loads of them have popped up across the Internet.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net