FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Adoordd , xbrowse
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Adoordd , xbrowse
Posted: Thu Oct 27, 2016 10:35 AM

Hello ,

I try to use Adordd with xbrowse and have problems :

1) Opening a table like :

USE table VIA "ADORDD" ALIAS alias NEW
oRs := USRRDD_AREADATA( Select() )[1]
DBG oRs:CursorType , oRs:CursorLocation , oRs:LockType
3 3 3
In AdoRdd i can see oRecordSet:Open(......., , adOpenDynamic , .... )

Cursortype ist'n 2 as expected but 3 (adOpenStatic)

2) Ors:Delete() gives an error without a proper message

3) Ors:Fileds("First"):Value := "Test" , gives :

(DOS Error -2147352567) WINOLE/1007 ... not allowed.... (0x800A0C93): ADODB.Recordset

4) Using it in xbrowse , oCol:bOnPostEdit doesn't work , probably due to a TRY .. CATCH construction

I am able to avoid this errors :
2) Delete : use SQL statement followed by requery
4) Use fieldput() in bonpostedit

BUT It is still impossible to change the value from a logical field :

"2048 The record was not saved because optimistic concurrency was in use.",;

It seems only the case on logical fields , other fields can be modified.

Any sugestions ?

Frank

test
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Adoordd , xbrowse
Posted: Thu Oct 27, 2016 12:03 PM

Frank,

Please email antonio.ferreira@gmail.com to let him know about this

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: Adoordd , xbrowse
Posted: Thu Oct 27, 2016 02:47 PM

Frank,

Whats the adordd version ?

Whats your DB ?

Please confirm Fields not Fileds.

The adordd mimics precisely the field types, lenghts, decimals as in dbf.
This is not the case in ADO.
Please read carefully the readme.pdf in github regarding numeric, decimals and logical fields.

Deletes done through adordd work exactly the same way as any other dbf kind of rdd.
Rows are not removed!

Can you try to use adordd in xBrowse as any other dbf kind of rdd instead of xBrowse managing ado object directly ?

Im checking your errors and will revert.

Regards

Antonio H Ferreira
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Re: Adoordd , xbrowse
Posted: Thu Oct 27, 2016 03:45 PM
AHF wrote:Frank,

Whats the adordd version ?

Whats your DB ?

Please confirm Fields not Fileds.

The adordd mimics precisely the field types, lenghts, decimals as in dbf.
This is not the case in ADO.
Please read carefully the readme.pdf in github regarding numeric, decimals and logical fields.

Deletes done through adordd work exactly the same way as any other dbf kind of rdd.
Rows are not removed!

Can you try to use adordd in xBrowse as any other dbf kind of rdd instead of xBrowse managing ado object directly ?

Im checking your errors and will revert.



Antonio ,

Thanks for your answer

1) Fileds was a typemismatch , in the program it was ok
2) I downloaded from github last month , adordd.prg is from 08-12-2015
3) I use adorddd in xbrowse as :

SET ADO DEFAULT DATABASE TO ( cDbfFile ) SERVER TO "ACCESS" ENGINE TO "ACCESS" USER TO "" PASSWORD TO ""
USE ("table") VIA "ADORDD" ALIAS ("alias") NEW
....
oRs := USRRDD_AREADATA( Select() )[1]
//
oRs:Fields("First"):Value := "Test" // error !
oRs:Delete(1) // error ; no message
//
....
@ 0,0 XBROWSE oBrw OF oWndChild ;
RECORDSET oRs;

Changing recordset in alias works to (didn't know)


I tryed to avoid the CLIPPER DELETE facility's , so that e delete field is not needed , making some changes in adordd.

I will test it again without these changes, but it seemed to be ok, at least all was working (except the errors)

Frank
test
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Re: Adoordd , xbrowse
Posted: Fri Oct 28, 2016 07:58 AM

Antonio ,

Changing RECORDSET to Alias in definition from xbrowse resolves :

oBrw:Delete() works

oCol:bOnPostedit (oCol:Value := x) works , EXCEPT ON LOGICAL FIELDS :

Error description: (DOS Error -2147352567) WINOLE/1007 De bewerking is in deze context niet toegestaan. (0x800A0C93): ADODB.Recordset

(The operation is not permitted in this context)

Correct ?
case cType == "L"
oCol:nEditType := EDIT_LISTBOX
oCol:aEditListTxt := { ".T.", ".F." }
oCol:aEditListBound := { .T., .F. }
oCol:aEditListBound := {1,0}

Frank

test
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: Adoordd , xbrowse
Posted: Fri Oct 28, 2016 01:47 PM

Frank,

Are the logical fields declared in SET ADO TABLES LOGICAL FIELDS LIST TO ?

Regards

Antonio H Ferreira
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Re: Adoordd , xbrowse
Posted: Sat Oct 29, 2016 08:45 AM
AHF wrote:Frank,

Are the logical fields declared in SET ADO TABLES LOGICAL FIELDS LIST TO ?


Antonio ,

Working with ADO , logical fields are recognised :

IF nType == adBoolean .OR. ADO_IS_FIELD_LOGICAL( aWAData[ WA_TABLEINDEX ], oField )

nType is adBoolean (11) .OR. clausule doesn't matter

I tested with SET ADO TABLES LOGICAL FIELDS LIST TO { { "CUSTOMER", { "MARRIED" } } }

next code :

....
oBrw:CreateFromCode()
# ifdef TEST
//oBrw:Delete() ok now
? oBrw:oCol("Married"):Value // Shows .T.
oBrw:oCol("Married"):Value := .F.
# endif

Shows only a window "Attention" , then the aplication freezes .
"2048 The record was not saved because optimistic concurrency was in use."
doesn't appear anymore

I tried also to set locktype to adLockPessimistic ( in adordd , oRecordSet:Open( ....,2,...) )
This result in locktype 4 (adLockBatchOptimistic)

Frank


I am afraid that when i can not resolve this issue , i can not use adordd.

Frank
test
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: Adoordd , xbrowse
Posted: Mon Oct 31, 2016 10:17 AM
Frank,

Here in Access its working ok with REPLACE. Didnt tried with ADO directly.

In some engines ADO doesnt recognized the field as adBoolean.
The adordd SET´s are only used when we are working with rdd functions like REPLACE, fieldput, etc.
If we are addressing it directly through ADO these will never be called.

Can you try :
Code (fw): Select all Collapse
REPLACE married WITH .F.


Next you can try:
Code (fw): Select all Collapse
? oBrw:oCol("Married"):Value // Shows .T. 
oBrw:oCol("Married"):Value := 0
Regards

Antonio H Ferreira
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Re: Adoordd , xbrowse
Posted: Tue Nov 01, 2016 09:14 AM
AHF wrote:Frank,

Here in Access its working ok with REPLACE. Didnt tried with ADO directly.

In some engines ADO doesnt recognized the field as adBoolean.
The adordd SET´s are only used when we are working with rdd functions like REPLACE, fieldput, etc.
If we are addressing it directly through ADO these will never be called.

Can you try :
Code (fw): Select all Collapse
REPLACE married WITH .F.


Next you can try:
Code (fw): Select all Collapse
? oBrw:oCol("Married"):Value // Shows .T. 
oBrw:oCol("Married"):Value := 0


Antonio ,

Thanks four your answer , but

REPLACE WITH or oRs:Fields("Married"):Value := ... gives error in ADO_SKIPRAW , oRs:Move(nToSkip)

oBrw:oCol("Married"):Value := 0
oBrw:Refresh()
trace(oBrw:oCol("First"):Value , oBrw:oCol("Married"):Value)

No Error , but field married doesn't change from value , still .T.
test
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Re: Adoordd , xbrowse
Posted: Tue Nov 01, 2016 11:24 AM

Antonio ,

I made some tests . When i don't use ADORDD i got the same error from xbrowse , ADOSKIP (FWH1404)

Testing :
1) After creating ORS
oRs:Fields("Married"):Value := 1
trace(oRs:Fields("Married"):Value)
OK

2) After creating browse and oBrw:CreateFromCode()
oRs:Fields("Married"):Value := 0
trace(oRs:Fields("Married"):Value) // Error

I suppose AdoRdd isn't the guilty , maybe FWH1404

Frank

test

Continue the discussion