🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.intrabuilder.data.sql
Article #62

bad documentation witj select fields

#62
From: Peter Wilk
Date: Mon, 06 Apr 1998 00:00
57 lines
2088 bytes

please help,
  i've design the following custom component in intrabuilder - strictly
sticking to the
help file: however if i drop it on a form i encounter the probelm, that the
active property
is set to true which prvents me from setting the database property. on the
other hand if i
set the active property to false i get the error "invalid array index"
pointing to the
..fields["CAR_BRAND"] item ?
how to solve this ? - TIA peter
class qryCarCover extends Query custom {
   with (this) {
      sql = "SELECT * from CAR";
      active = true;
   }
   with (this.rowset) {
    fields["CAR_BRAND"].beforeGetValue = class::Brand_beforeGetValue
      fields["CAR_BRAND"].canChange = class::Brand_canChange
   }
   function onOpen()
   {
    with( this.qBrandnames = new Query() ) {
       sql = "SELECT * FROM BRAND";
         active = true;
      }
   }
   function Brand_beforeGetValue()
   {
    if (this.parent.parent.endOfSet) {
       return null;
      }
      else if (this.value == null) {
       return "";
      }
      else {
       var r = this.parent.parent.parent.qBrandnames.rowset;
         return r.applyLocate('BRAND_ID = ' + this.value) ?
r.fields["BRAND_name"].value : "unbekannte Marke";
      }
   }
   function Brand_canChange( Brand)
   {
    var r = this.parent.parent.qBrandname.rowset;
      if ( r.applyLocate('BRAND_name = \'' + Brand + '\'')) {
       this.value = r.fields["BRAND_ID"].value;
      }
      return false;
   }
}

--
Dr. Peter Wilk
Assistance and Insurance Consulting
http://ourworld.compuserve.com/homepages/PeterWilk
Technical Details
Message-ID: <6gbcuu$l5o6@forums.borland.com>
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: 101d9a,26cc8171ed9a0229,start
X-Google-Attributes: gid101d9a,public
From: "Peter Wilk" <PeterWilk@compuserve.com>
Subject: bad documentation witj select fields
Date: 1998/04/06
Message-ID: <6gbcuu$l5o6@forums.borland.com>
X-Deja-AN: 341456064
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.intrabuilder.data.sql