Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

I show part of this script if recordset is not empty

I have the following script (below). I want to show the value for rte.Txt IF the recordset "rs_lttmrg" is NOT EMPTY

--

                // Create Editor instance and use Text property to load content into the RTE.  
                Dim rte
                Set rte=new RichTextEditor  

Show the value in this line below it recordset is not empty, otherwise value should be = ""

                        rte.Text=(rs_lttrmrg.Fields.Item("LtrBody").Value)



                        // Set a unique ID to Editor  
                rte.ID="editor1"  
                        rte.Width="800px"  
                        rte.Toolbar="bluedot"
                rte.MvcInit()  
                // Render Editor
                Response.Write(rte.GetString())

---

How can I do this ?
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

No go ...

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/bluedot/Intranet/qnr/Indexqnr.asp, line 212


line 212 is:  rte.Text=""

weird
Avatar of Aleks

ASKER

The problem is NOT that the value of the field is "" or NULL, the problem is that the recordset is empty.
Avatar of Aleks

ASKER

This seem to work.

' Show the value in this line below it recordset is not empty, otherwise value should be = ""
rte.Text=""
  If Not rs_lttrmrg.EOF Or Not rs_lttrmrg.BOF Then
   rte.Text = rs_lttrmrg.Fields.Item("LtrBody").Value
End If ' end Not rs_lttrmrg.EOF Or NOT rs_lttrmrg.BOF
// Create Editor instance and use Text property to load content into the RTE.  
Dim rte
Set rte=new RichTextEditor   

' Show the value in this line below it recordset is not empty, otherwise value should be = ""
rte.Text=""

If False = rs_lttrmrg.EOF Then
   If CStr(rs_lttrmrg.Fields.Item("LtrBody").Value) <> "" Then
      rte.Text = rs_lttrmrg.Fields.Item("LtrBody").Value
   End If
End If

Open in new window