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


Groups > comp.lang.clipper.visual-objects > #11053 > unrolled thread

ADS Locking

Started byFrank M <frank_muessner@gmx.de>
First post2017-10-16 01:34 -0700
Last post2017-10-17 01:39 -0700
Articles 13 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  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

#11053 — ADS Locking

FromFrank M <frank_muessner@gmx.de>
Date2017-10-16 01:34 -0700
SubjectADS Locking
Message-ID<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? 













[toc] | [next] | [standalone]


#11055

FromMartin <Martin@spam.spam>
Date2017-10-16 10:20 +0100
Message-ID<os1tk6$4pp$1@dont-email.me>
In reply to#11053
ADS support is now pretty painfull.

As to locking, not had any issues using sql with DBF.

But it may be related to opportunist locking or something of that ilk.



On 16/10/2017 09:34, Frank M wrote:
> 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?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

[toc] | [prev] | [next] | [standalone]


#11056

FromFrank M <frank_muessner@gmx.de>
Date2017-10-16 03:33 -0700
Message-ID<c442383c-33c8-42e2-bb1c-6fb6cf57e302@googlegroups.com>
In reply to#11053
Am Montag, 16. Oktober 2017 10:34:29 UTC+2 schrieb Frank M:
> 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?

Hi Martin, 

i think that have something to do with opportunist locking, too. 
Is there an other option to set? 
when using AX_AXSLocking( .T. ) or AX_AXSLocking( .F. ) it makes no different. 
Frank 

[toc] | [prev] | [next] | [standalone]


#11062

FromD.J.W. van Kooten <vankooten@removethis.ic2.com>
Date2017-10-20 17:10 +0200
Message-ID<n64kuc1qbk2kqut30u3ffaoqubv302a4qf@4ax.com>
In reply to#11056
Replying on message of Mon, 16 Oct 2017 03:33:36 -0700 (PDT) from
Frank M:


 Hello Frank,

>i think that have something to do with opportunist locking, too. 
>Is there an other option to set? 
>when using AX_AXSLocking( .T. ) or AX_AXSLocking( .F. ) it makes no different. 



I use DBF + ADS and for that both SQL and DBF  compatible data
handling works with: 

1 AX_AXSLocking(true)

2  In the ADS configuration utility Non proprietary locking checked

If step 2 is done and you try to open a file (e.g. outside your
program) without ADS it will show as read only.

But you probably knew this already....


Dick

[toc] | [prev] | [next] | [standalone]


#11078

FromFrank M <frank_muessner@gmx.de>
Date2017-10-24 00:27 -0700
Message-ID<31578da3-2742-48b4-924f-e63df0822dac@googlegroups.com>
In reply to#11062
Am Freitag, 20. Oktober 2017 17:10:14 UTC+2 schrieb D.J.W. van Kooten:
> Replying on message of Mon, 16 Oct 2017 03:33:36 -0700 (PDT) from
> Frank M:
> 
> 
>  Hello Frank,
> 
> >i think that have something to do with opportunist locking, too. 
> >Is there an other option to set? 
> >when using AX_AXSLocking( .T. ) or AX_AXSLocking( .F. ) it makes no different. 
> 
> 
> 
> I use DBF + ADS and for that both SQL and DBF  compatible data
> handling works with: 
> 
> 1 AX_AXSLocking(true)
> 
> 2  In the ADS configuration utility Non proprietary locking checked
> 
> If step 2 is done and you try to open a file (e.g. outside your
> program) without ADS it will show as read only.
> 
> But you probably knew this already....
> 
> 
> Dick

Hi Dick, 

no, i found no solution. I think, i try everything. 
what connection you use? AdsConnect60() or AdsConnect101()? Du you use ADD? 


Frank 





 

[toc] | [prev] | [next] | [standalone]


#11080

FromD.J.W. van Kooten <vankooten@removethis.ic2.com>
Date2017-10-24 12:16 +0200
Message-ID<bl4uuc9bhkdht5r9e8d4t2niquldvlnerq@4ax.com>
In reply to#11078
Replying on message of Tue, 24 Oct 2017 00:27:08 -0700 (PDT) from
Frank M:


 Hello Frank,

>what connection you use? AdsConnect60() or AdsConnect101()? Du you use ADD? 

ADSConnect60 & no, just DBF. 

Do you have a basic test program which reproduces the problem? If so,
you can mail it to me and I see what happens here and I can compare it
to the code I have. E.g. see if it works when I bring it to DBF.

Dick

[toc] | [prev] | [next] | [standalone]


#11089

FromFrank M <frank_muessner@gmx.de>
Date2017-10-25 23:56 -0700
Message-ID<4c9918a9-60eb-45b6-a54a-434e82d306d3@googlegroups.com>
In reply to#11080
Am Dienstag, 24. Oktober 2017 12:16:38 UTC+2 schrieb D.J.W. van Kooten:
> Replying on message of Tue, 24 Oct 2017 00:27:08 -0700 (PDT) from
> Frank M:
> 
> 
>  Hello Frank,
> 
> >what connection you use? AdsConnect60() or AdsConnect101()? Du you use ADD? 
> 
> ADSConnect60 & no, just DBF. 
> 
> Do you have a basic test program which reproduces the problem? If so,
> you can mail it to me and I see what happens here and I can compare it
> to the code I have. E.g. see if it works when I bring it to DBF.
> 
> Dick

Hi Dick, 
thaks, i will make a sample when back to Office. 
Frank 

[toc] | [prev] | [next] | [standalone]


#11090

FromFrank M <frank_muessner@gmx.de>
Date2017-10-26 03:14 -0700
Message-ID<4b1b3c31-427c-41e7-b641-f87e6b2fd9c8@googlegroups.com>
In reply to#11080
Am Dienstag, 24. Oktober 2017 12:16:38 UTC+2 schrieb D.J.W. van Kooten:
> Replying on message of Tue, 24 Oct 2017 00:27:08 -0700 (PDT) from
> Frank M:
> 
> 
>  Hello Frank,
> 
> >what connection you use? AdsConnect60() or AdsConnect101()? Du you use ADD? 
> 
> ADSConnect60 & no, just DBF. 
> 
> Do you have a basic test program which reproduces the problem? If so,
> you can mail it to me and I see what happens here and I can compare it
> to the code I have. E.g. see if it works when I bring it to DBF.
> 
> Dick

Hi Dick, 
can you give your mail Adress, please?
Frank

[toc] | [prev] | [next] | [standalone]


#11092

FromD.J.W. van Kooten <vankooten@removethis.ic2.com>
Date2017-10-26 16:54 +0200
Message-ID<ont3vc17iu7e6f2qbcucj1m850jfaig2d8@4ax.com>
In reply to#11090
Replying on message of Thu, 26 Oct 2017 03:14:10 -0700 (PDT) from
Frank M:


 Hello Frank,

>can you give your mail Adress, please?


It's in the NG message header.

vankooten

and the 2ne part is ic2 (+com)

Dick

[toc] | [prev] | [next] | [standalone]


#11057

FromGerhard Bunzel <g.bunzel@domonet.de>
Date2017-10-16 12:57 +0200
Message-ID<os23au$4ns$1@news-1.m-online.net>
In reply to#11053
Frank,

....maybe this works for your locking:


lReturn = AdsLockRecord( lhTable, 0 )
IF lReturn = TRUE
    …..

and

lReturn = AdsUnlockRecord( lhTable, 0 )


http://devzone.advantagedatabase.com/dz/WebHelp/Advantage7.1/mergedProjects/ace/api1/adslockrecord.htm


HTH

Gerhard Bunzel


Am 16.10.2017 um 10:34 schrieb Frank M:
> 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?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

[toc] | [prev] | [next] | [standalone]


#11058

FromFrank M <frank_muessner@gmx.de>
Date2017-10-16 05:21 -0700
Message-ID<3d8fc112-114f-4ea1-95da-c33b343f6e86@googlegroups.com>
In reply to#11053
Am Montag, 16. Oktober 2017 10:34:29 UTC+2 schrieb Frank M:
> 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?

Hi Gerhard, 

that i can only use, when API Calls using. I have the SQLDBServer, with RLock() it work´s, but so i have to change all code with Rlock. 

Frank 

[toc] | [prev] | [next] | [standalone]


#11059

From"Jamal" <noooospam@example.com>
Date2017-10-16 11:24 -0400
Message-ID<os2ium$mu4$1@news.albasani.net>
In reply to#11053
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?












[toc] | [prev] | [next] | [standalone]


#11060

FromFrank M <frank_muessner@gmx.de>
Date2017-10-17 01:39 -0700
Message-ID<32846a57-52c7-4642-9add-8502852273e4@googlegroups.com>
In reply to#11053
Am Montag, 16. Oktober 2017 10:34:29 UTC+2 schrieb Frank M:
> 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?

Hi Jamal, 

i will try to implement this and look how to make ow change of my old code. 

Thanks, Frank 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web