Subject Re: Rowset at the end of Set
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Mon, 19 Feb 2024 05:11:03 -0800
Newsgroups dbase.getting-started
Attachment(s) lpo2.wfmtempsal5.dbftempsal5.DBT

On 2/19/2024 12:26 AM, Mervyn Bick wrote:
> On 2024/02/18 15:27, Ken Mayer wrote:
>
>> This isn't ADO specific. I did this with a local table and got the
>> same results. It's specifically the grid's editorControl being set to
>> the editor, and an empty rowset. Very odd.
>>
>> Ken
>>
>
> I must admit I hadn't tested this with a local table.  I'm afraid I
> can't replicate the error.
>
> My little test form is attached.

With the form attached, it does exactly as described by Mustansir. It's
a simple table, the grid uses the editor control datalinked to a memo
field (table also attached). Run it, the table is empty, click the
button, you get the "Rowset at end of set" error. If you uncomment one
of the two commented statements in the pushbutton code, and recompile
the form, run it, click the button, no error.

Ken



--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm



** END HEADER -- do not remove this line
//
// Generated on 02/18/2024
//
parameter bModal
local f
f = new lpo2Form()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class lpo2Form of FORM
   with (this)
      metric = 6        // Pixels
      height = 527.0
      left = 9.0
      top = 0.0
      width = 671.0
      text = ""
      windowState = 0        // Normal
   endwith

   this.QTEMPSAL = new QUERY(this)
   with (this.QTEMPSAL)
      left = 896.0
      sql = "select * from tempsal5 "
      requestLive = false
      active = true
   endwith

   this.GRID1 = new GRID(this)
   with (this.GRID1)
      fontName = "Calibri"
      fontSize = 12.0
      headingFontName = "Calibri"
      headingFontSize = 12.0
      dataLink = form.qtempsal.rowset
      columns["Column1"] = new GRIDCOLUMN(form.GRID1)
      with (columns["Column1"])
         dataLink = form.qtempsal.rowset.fields["item"]
         editorType = 5        // Editor
         width = 410.0
      endwith
      columns["Column2"] = new GRIDCOLUMN(form.GRID1)
      with (columns["Column2"])
         dataLink = form.qtempsal.rowset.fields["item_num"]
         width = 110.0
      endwith
      with (columns["Column1"].editorControl)
         fontName = ""
         dropDownHeight = 176.0
      endwith

      with (columns["Column1"].headingControl)
         fontName = ""
         value = "ITEM DESCRIPTION"
      endwith

      with (columns["Column2"].editorControl)
         fontName = ""
      endwith

      with (columns["Column2"].headingControl)
         fontName = ""
         value = "Item_num"
      endwith

      headingHeight = 25.0
      cellHeight = 20.0
      hasColumnHeadings = false
      allowEditing = false
      allowAddRows = false
      height = 323.0
      left = 21.0
      top = 33.0
      width = 539.0
   endwith

   this.PBCLOSE = new PUSHBUTTON(this)
   with (this.PBCLOSE)
      onClick = class::PBCLOSE_ONCLICK1
      height = 66.0
      left = 168.0
      top = 385.0
      width = 217.0
      text = "Form Close"
      fontName = "Calibri"
      fontSize = 12.0
   endwith


  

   function PBCLOSE_onClick1()
      if form.QTEMPSAL.rowset.count() == 0
         //form.grid1.columns["COLUMN1"].editorType := 1
         //form.grid1.dataLink := null
      endif
             form.close()
   return

endclass