Adoordd , xbrowse

Adoordd , xbrowse

Postby Franklin Demont » 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
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: Adoordd , xbrowse

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Adoordd , xbrowse

Postby AHF » Thu Oct 27, 2016 2: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: Adoordd , xbrowse

Postby Franklin Demont » Thu Oct 27, 2016 3: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
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: Adoordd , xbrowse

Postby Franklin Demont » Fri Oct 28, 2016 7: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
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: Adoordd , xbrowse

Postby AHF » Fri Oct 28, 2016 1:47 pm

Frank,

Are the logical fields declared in SET ADO TABLES LOGICAL FIELDS LIST TO ?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: Adoordd , xbrowse

Postby Franklin Demont » Sat Oct 29, 2016 8: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
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: Adoordd , xbrowse

Postby AHF » 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: Select all  Expand view

REPLACE married WITH .F.
 


Next you can try:
Code: Select all  Expand view

? oBrw:oCol("Married"):Value // Shows .T.
oBrw:oCol("Married"):Value := 0
 
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: Adoordd , xbrowse

Postby Franklin Demont » Tue Nov 01, 2016 9: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: Select all  Expand view

REPLACE married WITH .F.
 


Next you can try:
Code: Select all  Expand view

? 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
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: Adoordd , xbrowse

Postby Franklin Demont » 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
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Silvio.Falconi and 39 guests