Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11059

Re: ADS Locking

From "Jamal" <noooospam@example.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: ADS Locking
Date 2017-10-16 11:24 -0400
Organization albasani.net
Message-ID <os2ium$mu4$1@news.albasani.net> (permalink)
References <dc28031e-a5bb-472b-99b3-772ccea01a58@googlegroups.com>

Show all headers | View raw


Frank,

I do not use ADS, but to handle locking yourself, you may need to add :

oServer: ConcurrencyControl := CCNONE in the init method of the the 
inherited AdsSQLServer class.

Also, I suggest you revise the code since you are not pointing to the 
correct record.

oServer := AdsSQLServer{"select * from ffr",,,"AXSQLADT"}

    for I:=1 to oServer:LastRec
        oServer:goto(i)        //  a MUST
        if ! oServer:EOF
          oMainWindow:Caption:=oServer:FIELDGET(#test)
           if oServer:RLOCK()    ->>> i have to lock the record.
               oServer:FIELDPUT(#test1,"WW")   //---> error that the Record 
have to locked.
               oServer:commit()
               oServer:Unlock()    // also needed!
        ENDIF
         // oServer:Skip()  // you do not need this!!!
    next

Jamal

"Frank M"  wrote in message 
news:dc28031e-a5bb-472b-99b3-772ccea01a58@googlegroups.com...

Hello,

i try to change from DBF to ADT Format. And at same time i want to change 
code to SQL Syntax. So i run into this behavior:

Server is ADS10.1

SetAnsi(false)
SetCollation(#WINDOWS)

lREt:=AdsConnect60( psz("G:\XXXX\france.add"), 
ADS_REMOTE_SERVER,psz("XXXX"), psz("XXXX"), ADS_TCP_IP_CONNECTION , 
@hConnect )

if lREt=0

AX_SetConnectionHandle( hConnect )


//this work:
oDB:=AdsDBServer{"ffr",true,,"ADSADT"}
   for I:=1 to oDB:LastRec
    if ! oDB:EOF
       oMainWindow:Caption:=oDB:FIELDGET(#test)
       oDB:FIELDPUT(#test1,"WW")
       oDB:commit()
    endif
    oDB:Skip(1)
   next


But when using Sql Syntax, i get "Record has to be locked"

oServer := AdsSQLServer{"select * from ffr",,,"AXSQLADT"}
    for I:=1 to oServer:LastRec
if ! oServer:EOF
   oMainWindow:Caption:=oServer:FIELDGET(#test)
   //oServer:RLOCK()    ->>> i have to lock the record.
   oServer:FIELDPUT(#test1,"WW")   //---> error that the Record have to 
locked.
   oServer:commit()
ENDIF
        oServer:Skip()
    next



endif


can i change this, that i have not to change all code to use SqlSyntax?
Or have to use manually locking when working with sql recordsets?


Regards, Frank

Is there still ADS Forum?












Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

ADS Locking Frank M <frank_muessner@gmx.de> - 2017-10-16 01:34 -0700
  Re: ADS Locking Martin <Martin@spam.spam> - 2017-10-16 10:20 +0100
  Re: ADS Locking Frank M <frank_muessner@gmx.de> - 2017-10-16 03:33 -0700
    Re: ADS Locking D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2017-10-20 17:10 +0200
      Re: ADS Locking Frank M <frank_muessner@gmx.de> - 2017-10-24 00:27 -0700
        Re: ADS Locking D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2017-10-24 12:16 +0200
          Re: ADS Locking Frank M <frank_muessner@gmx.de> - 2017-10-25 23:56 -0700
          Re: ADS Locking Frank M <frank_muessner@gmx.de> - 2017-10-26 03:14 -0700
            Re: ADS Locking D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2017-10-26 16:54 +0200
  Re: ADS Locking Gerhard Bunzel <g.bunzel@domonet.de> - 2017-10-16 12:57 +0200
  Re: ADS Locking Frank M <frank_muessner@gmx.de> - 2017-10-16 05:21 -0700
  Re: ADS Locking "Jamal" <noooospam@example.com> - 2017-10-16 11:24 -0400
  Re: ADS Locking Frank M <frank_muessner@gmx.de> - 2017-10-17 01:39 -0700

csiph-web