🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #1157

Problem using UpdateSet Class for Data Access

#1157
From: Dave Bailey
Date: Wed, 22 Apr 1998 00:00
125 lines
3521 bytes
I have a problem with the following Visual Dbase 7 code.
Can anyone please help?  The problem is with the Updatset Class.
If I leave out the IndexName property, all records are duplicated
in the file.  When I put it in I get the following error; "Database
Engine Error: Attempt to Mix Objects from different Sessions."
Also, the table in the "ChangedTableName" property does not get built.
Is that because records are only be added to the file?


parameter bModal
local f
f = new ItbForm()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class ItbForm of FORM
   with (this)
      onOpen = class::FORM_ONOPEN
      onClose = class::FORM_ONCLOSE
      scaleFontBold = false
      colorNormal = "cyan"
      height = 9.8636
      left = 37
      top = 0
      width = 56.8571
      text = "ITB File Download"
   endwith


   this.SESSION1 = new SESSION()
   this.SESSION1.parent = this
   with (this.SESSION1)
      left = -0.1429
      top = -0.0455
      lockRetryInterval = 0
   endwith


   this.DATABASE2 = new DATABASE()
   this.DATABASE2.parent = this
   with (this.DATABASE2)
      left = 4
      top = -0.0455
      databaseName = "PC400"
      session = form.SESSION1
      active = true
   endwith


   this.QUERY1 = new QUERY()
   this.QUERY1.parent = this
   with (this.QUERY1)
      left = 8
      top = -0.0455
      session = form.SESSION1
      database = form.database2
      sql = "Select * from DAVE.DBF"
      requestLive = false

   endwith

   this.TXT_MSG1 = new TEXT(this)
   with (this.TXT_MSG1)
      height = 2
      left = 1
      top = 1.5
      width = 54
      border = true
      colorNormal = "blue/cyan"
      fontName = "Comic Sans MS"
      fontSize = 18
      text = "Updating the PC-ITB File Now..."
      borderStyle = 5	// Double
   endwith

   this.PROGRESS1 = new PROGRESS(this)
   with (this.PROGRESS1)
      height = 1
      left = 4
      top = 5.5
      width = 48
      value = 0
      rangeMin = 0
      rangeMax = 100
   endwith

   this.TXT_MSG2 = new TEXT(this)
   with (this.TXT_MSG2)
      height = 1
      left = 5
      top = 7
      width = 44
      border = true
      colorNormal = "blue/cyan"
      fontName = "Comic Sans MS"
      text = "Opening the Query Now....."
      borderStyle = 6	// Drop Shadow
   endwith

  function form_onClose
      form.Release()
      return

   function form_onOpen
* OPEN THE AS400 QUERIES
      form.Txt_Msg2.Text="Opening the Query Now....."
      form.Query1.Active=true
      form.Progress1.Value=50
      form.Txt_Msg2.Text="Updating the PC File Now...."
      form.UPDATESET1 = New UPDATESET()
      form.UpdateSet1.Source=form.Query1.Rowset
      form.UpdateSet1.Destination="DAVE2.DBF"
      form.UpdateSet1.ChangedTableName="TBLECHNG.DBF"
      form.UpdateSet1.IndexName="IBITB"
      form.UpdateSet1.AppendUpdate()
      form.Progress1.Value=100
      form.Txt_Msg2.Text="The Update is Complete...."
      return

endclass
Technical Details
Message-ID: <01bd6d82$1fec5540$4402a8c0@cps1>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,f357315af881fa22,start
X-Google-Attributes: gidff5a1,public
From: "Dave Bailey" <cal-pak@ix.netcom.com>
Subject: Problem using UpdateSet Class for Data Access
Date: 1998/04/22
Message-ID: <01bd6d82$1fec5540$4402a8c0@cps1>
X-Deja-AN: 346472483
Organization: Netcom
X-NETCOM-Date: Tue Apr 21  7:04:10 PM CDT 1998
Newsgroups: borland.public.vdbase.data.sql