topic
stringlengths
1
63
text
stringlengths
1
577k
ADO RDD xHarbour
Rick, Thanks for sharing it. Now adordd do exactly that with set relation to... Do you have and performance experience with :find?
ADO RDD xHarbour
Antonio Using :Find you MUST :MoveFirst() before you issue the :Find() .. you might also use :Filter [code=fw:30albfwl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRsInvoice:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oRsInvoice:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"[InvoiceNumber] = "</span>+ltrim+str<span style="color: #000000;">&#40;</span>nRepairNumber<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />or<br /><br />oRsInvoice:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">"[InvoiceNumber] = "</span>+ltrim+str<span style="color: #000000;">&#40;</span>nRepairNumber<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <br /><br />&nbsp;</div>[/code:30albfwl] Rick Lipkin
ADO RDD xHarbour
Rick, Adordd uses seek in the following way (also with relations). It works just like dbfs any changes needed in app code. See the code We will have another function adoseek(cKey) to build a recordset with the ckey expresssion as where clause and adoseek() to revert to the previous recordset. Its faster than the ado_seek() but you will need to insert these changes into your app code. [code=fw:9a49e3i0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_SEEK<span style="color: #000000;">&#40;</span> nWA, lSoftSeek, cKey, lFindLast <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oRecordSet := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aWAData := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aSeek,cSql,nRecno,oRs := TempRecordSet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> lSoftSeek <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> cKey <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> lFindLast <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lFindLast <span style="color: #0000ff;">TO</span> .F.<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lSoftSeek <span style="color: #0000ff;">TO</span> .F.<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ADOEMPTYSET<span style="color: #000000;">&#40;</span>oRecordSet<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_FOUND <span style="color: #000000;">&#93;</span> := ! oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; MSGALERT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No Index active seek not allowed!"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//SHOULD RAISE ERROR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_FAILURE<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;aSeek := ADOPseudoSeek<span style="color: #000000;">&#40;</span>nWA,cKey,aWAData,lSoftSeek<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//this tell us if we are in a subset of records from previous seek we need to reset to defaut to have another seek</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span>WA_ISITSUBSET<span style="color: #000000;">&#93;</span> .AND. aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">//ONLY IF ITS FIND IF SEEK NEW RECORDSET WILL BE ALWAYS CREATED</span><br /><br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cSql := IndexBuildExp<span style="color: #000000;">&#40;</span>nWA,aWAData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span>,aWAData<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSql,aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">//no more than one field in the expression we can use find</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//eof control doesnt matter in seek that are really selects THATS WHY ITS HERE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//for finds lets place in &nbsp;row 1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oRecordSet:<span style="color: #000000;">EOF</span> .OR. oRecordSet:<span style="color: #000000;">BOF</span> .OR. &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> .OR. aWAData<span style="color: #000000;">&#91;</span> WA_BOF <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_BOF <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">BOF</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> lSoftSeek <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span> aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//SEE PSEUDOSEEK</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> lFindLast<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span> aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,,adSearchBackward<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span> aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span>&nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//attention multiple fields in cseek expression cannot emulate behaviour of lSoftSeek </span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//more than one field in the seek expression has to be select</span><br /><span style="color: #B900B9;">//MSGINFO(aSeek[2])</span><br />&nbsp; &nbsp; &nbsp; cSql := IndexBuildExp<span style="color: #000000;">&#40;</span>nWA,aWAData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span>,aWAData,.F.,aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//MSGINFO(CSQL)</span><br />&nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSql,aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//new temp recordset</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> !ADOEMPTYSET<span style="color: #000000;">&#40;</span>oRs<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//FOUNDED!</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> lFindLast <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRS:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span>&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// 100% SUPPORTED AND SAFE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nRecno := oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #B900B9;">//field autoinc</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oRS:<span style="color: #000000;">Supports</span><span style="color: #000000;">&#40;</span>adBookmark<span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">/* Although the Supports method may return True for a given functionality, it does not guarantee that <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the provider can make the feature available under all circumstances. <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The Supports method simply returns whether the provider can support the specified functionality,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;assuming certain conditions are met. For example, the Supports method may indicate that a <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Recordset object supports updates even though the cursor is based on a multiple table join, <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;some columns of which are not updatable*/</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> oRS:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .or. oRS:<span style="color: #000000;">Bof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nRecno := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span>&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nRecno := oRS:<span style="color: #000000;">BookMark</span><br />&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span>&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//ATTENTION NOT WORKING CORRECTLY WITH DELETED ROWS!2&nbsp; &nbsp; </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRecno := <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> oRS:<span style="color: #000000;">AbsolutePosition</span> == adPosEOF, oRS:<span style="color: #000000;">RecordCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span>, oRS:<span style="color: #000000;">AbsolutePosition</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//MUST TAKE OUT THE DELETED ROWS! OTHERWISE WRONG NRECNO </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//TODO nRecno := nRecno-nDeletedRows </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span>&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADO_GOTO<span style="color: #000000;">&#40;</span>nWA,nRecno<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span> &nbsp;<span style="color: #B900B9;">//NOT FOUND!</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// lSoftSeek DONT KNOW HOWTO!</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//TO CHECK NEXT CALLS IF WE ARE IN A SUBSSET TO REVERT TO DEFAULT SET</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span>WA_ISITSUBSET<span style="color: #000000;">&#93;</span> := .F.<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span>&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_FOUND <span style="color: #000000;">&#93;</span> := ! oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp;</div>[/code:9a49e3i0]
ADO RDD xHarbour
Antonio, Enrico, Lucas, Do you have any experience use SELECT * FROM cTable with adUseServer and adUserClient ? Does ADO load all rows? Is there a way to avoid that? CacheSize? MaxRecords? I have now a new adordd version imitating 100% dbf behaviour, however Im afraid that during trials this will be slow because of the use of SELECT as explained above and the use of find to locate record number. With adUseClient we can use ADO index property for field recno but I dont have any trials on this. Besides this, with new version all browses in the app work without any changes. The tester in our client says that with Oracle, although much slower than ADSrdd its ok. In ADSoledb its slow! In Mysql didnt tried yet. The table average size of this application is 100.000 Recs some with > 700.000. Can you share some of your experience? Here you have alternatives: 100% compatible dbf behavior [code=fw:31strp2h]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADOSEEKSQLFIND<span style="color: #000000;">&#40;</span> nWA, lSoftSeek, cKey, lFindLast <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oRecordSet := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aWAData := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aSeek,cSql,nRecno,oRs := TempRecordSet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,E<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> lSoftSeek <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> cKey <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> lFindLast <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lFindLast <span style="color: #0000ff;">TO</span> .F.<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lSoftSeek <span style="color: #0000ff;">TO</span> .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ADOEMPTYSET<span style="color: #000000;">&#40;</span>oRecordSet<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_FOUND <span style="color: #000000;">&#93;</span> := ! oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; MSGALERT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No Index active seek not allowed!"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//SHOULD RAISE ERROR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_FAILURE<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;aSeek := ADOPseudoSeek<span style="color: #000000;">&#40;</span>nWA,cKey,aWAData,lSoftSeek<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cSql := IndexBuildExp<span style="color: #000000;">&#40;</span>nWA,aWAData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span>,aWAData,.F.,<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>,aseek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSql,aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lSoftSeek .AND. ADOEMPTYSET<span style="color: #000000;">&#40;</span>oRs<span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// DIDNT FIND SFOTSEEK ON LOOK FOR THE NEXT KEY where field > key</span><br />&nbsp; &nbsp; &nbsp; cSql := STRTRAN<span style="color: #000000;">&#40;</span>cSql,<span style="color: #ff0000;">"SELECT "</span>,<span style="color: #ff0000;">"SELECT TOP 1 "</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//first following record SOFTSEEK</span><br />&nbsp;&nbsp; &nbsp; &nbsp;oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSql,aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !ADOEMPTYSET<span style="color: #000000;">&#40;</span>oRs<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//FOUNDED!</span><br />&nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> lFindLast<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRs:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span>&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// 100% SUPPORTED AND SAFE</span><br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRecno := oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> oRS:<span style="color: #000000;">Supports</span><span style="color: #000000;">&#40;</span>adBookmark<span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//Although the Supports method may return True for a given functionality, it does not guarantee that </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//the provider can make the feature available under all circumstances. </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//The Supports method simply returns whether the provider can support the specified functionality,</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//assuming certain conditions are met. For example, the Supports method may indicate that a </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//Recordset object supports updates even though the cursor is based on a multiple table join, </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//some columns of which are not updatable</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oRS:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .or. oRS:<span style="color: #000000;">Bof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; nRecno := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span>&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRecno := oRS:<span style="color: #000000;">BookMark</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span>&nbsp; &nbsp;&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//ATTENTION NOT WORKING CORRECTLY WITH DELETED ROWS!2&nbsp; &nbsp;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nRecno := <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> oRS:<span style="color: #000000;">AbsolutePosition</span> == adPosEOF, oRS:<span style="color: #000000;">RecordCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span>, oRS:<span style="color: #000000;">AbsolutePosition</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//MUST TAKE OUT THE DELETED ROWS! OTHERWISE WRONG NRECNO </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//TODO nRecno := nRecno-nDeletedRows </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span>&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; ADO_GOTO<span style="color: #000000;">&#40;</span>nWA,nRecno<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span> &nbsp;<span style="color: #B900B9;">//NOT FOUND!</span><br /><br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// eof()</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;oRs:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_FOUND <span style="color: #000000;">&#93;</span> := ! oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #B900B9;">//TO CHECK NEXT CALLS IF WE ARE IN A SUBSSET TO REVERT TO DEFAULT SET</span><br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span>WA_ISITSUBSET<span style="color: #000000;">&#93;</span> := .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span>WA_PENDINGREL<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> .AND. PROCNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <> <span style="color: #ff0000;">"ADO_RELEVAL"</span> <span style="color: #B900B9;">//ENFORCE REL CHILDS BUT NOT IN A ENDLESS LOOP!</span><br />&nbsp; &nbsp; &nbsp; ADO_FORCEREL<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp;<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br /><br />&nbsp;</div>[/code:31strp2h] Fast but not 100% compatible dbf behavior [code=fw:31strp2h]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADOSEEKSQL<span style="color: #000000;">&#40;</span> nWA, lSoftSeek, cKey, lFindLast <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oRecordSet := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aWAData := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aSeek,cSql<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> lSoftSeek <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> cKey <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> lFindLast <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lFindLast <span style="color: #0000ff;">TO</span> .F.<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lSoftSeek <span style="color: #0000ff;">TO</span> .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; MSGALERT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No Index active seek not allowed!"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//SHOULD RAISE ERROR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_FAILURE<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;aSeek := ADOPseudoSeek<span style="color: #000000;">&#40;</span>nWA,cKey,aWAData,lSoftSeek<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;cSql := IndexBuildExp<span style="color: #000000;">&#40;</span>nWA,aWAData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span>,aWAData,.F.,<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>,aseek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,aSeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oRecordSet:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;oRecordSet:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSql,aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #B900B9;">//TO CHECK NEXT CALLS IF WE ARE IN A SUBSSET TO REVERT TO DEFAULT SET</span><br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span>WA_ISITSUBSET<span style="color: #000000;">&#93;</span> := .T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !ADOEMPTYSET<span style="color: #000000;">&#40;</span>oRecordSet<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//FOUND!</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> lFindLast<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span>&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_FOUND <span style="color: #000000;">&#93;</span> := ! oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">EOF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span>WA_PENDINGREL<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> .AND. PROCNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <> <span style="color: #ff0000;">"ADO_RELEVAL"</span> <span style="color: #B900B9;">//ENFORCE REL CHILDS BUT NOT IN A ENDLESS LOOP!</span><br />&nbsp; &nbsp; &nbsp; ADO_FORCEREL<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp;<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp;</div>[/code:31strp2h]
ADO RDD xHarbour
Antonio, Dbeval calls UR_EVALBLOCK that calls ADO_EVALBLOCK. There is something missing because the block its not properly evaluated in SUM Can you help me finding out whats the problem? Is the RETURN correct? [code=fw:5xc8pm6v]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_EVALBLOCK<span style="color: #000000;">&#40;</span> nArea, bBlock, uResult <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nCurrArea<br /><br />&nbsp; &nbsp;nCurrArea := <span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nCurrArea != nArea<br />&nbsp; &nbsp; &nbsp; dbSelectArea<span style="color: #000000;">&#40;</span> nArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; nCurrArea := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;uResult := Eval<span style="color: #000000;">&#40;</span> bBlock <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nCurrArea > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; dbSelectArea<span style="color: #000000;">&#40;</span> nCurrArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp;</div>[/code:5xc8pm6v]
ADO RDD xHarbour
Antonio, Please show me how you use it from your PRG
ADO RDD xHarbour
Antonio, I solev the problem but dont know if the most correct way. App code (does not evaluate nothing) [code=fw:1dpglyqm]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">sum</span> quantidade <span style="color: #0000ff;">to</span> wreservas <span style="color: #00C800;">for</span> codigoprod+armazem==codigo .and.;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; len<span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span>nrfactur<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>=<span style="color: #000000;">0</span> <span style="color: #00C800;">while</span> <span style="color: #000000;">&#40;</span>wmain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">setmsg</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Verifcando totais reservas"</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1dpglyqm] New ADO_EVALBLOCK (it evaluates like ths) [code=fw:1dpglyqm]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_EVALBLOCK<span style="color: #000000;">&#40;</span> nArea, bBlock, uResult <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nCurrArea<br /><br />&nbsp; &nbsp;nCurrArea := <span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nCurrArea != nArea<br />&nbsp; &nbsp; &nbsp; dbSelectArea<span style="color: #000000;">&#40;</span> nArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; nCurrArea := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> PROCNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <> <span style="color: #ff0000;">"ADO_RELEVAL"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// DONT KNOW WHY BUT DBEVAL ONLY WORK LIKE THIS</span><br />&nbsp; &nbsp; &nbsp; UR_SUPER_EVALBLOCK<span style="color: #000000;">&#40;</span> nArea, bBlock, uResult <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span>&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; uResult := Eval<span style="color: #000000;">&#40;</span> bBlock <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nCurrArea > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; dbSelectArea<span style="color: #000000;">&#40;</span> nCurrArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp;</div>[/code:1dpglyqm]
ADO RDD xHarbour
Isn't uResult provided by reference ? If not, then this value will be lost: uResult := Eval( bBlock ) not sure if it will be also applicable to: UR_SUPER_EVALBLOCK( nArea, bBlock, uResult )
ADO RDD xHarbour
UR_SUPER_EVALBLOCK( nArea, bBlock, @uResult ) maybe ?
ADO RDD xHarbour
Antonio, I dont know if uResult it is provided by reference because its called from dbeval(). Dont know why but UR_SUPER_EVALBLOCK( nArea, bBlock, uResult ) works! (without @) Adordd its almost ready ! Now adordd its a true Rdd! There are big differences from previous posted version. Its much slower than DBF or ADS with few users but completely workable and the difference begin to decrease as more users are getting in. Ill report after the trials. The converted app is running quite ok with zero changes in the logic of the code. The only code changes we had to make were for locates and some index creation expressions, nothing else! Now we are testing every app routine and Im sure that we will still find some small bugs. We are still with some minor problems like the display of numeric fields on the browses (right just instead of left just) to be solved. Ill post the last version soon!
ADO RDD xHarbour
Antonio, You are doing a great work, congratulations! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, I await for last release, as current is buggy and can´t be used. Thank you.
ADO RDD xHarbour
New version of adordd at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m -->
ADO RDD xHarbour
Antonio, Some erros when compiling: STATIC FUNCTION ADO_OPEN( nWA, aOpenInfo ) IF oRecordSet:CursorLocation = adUseClient [b:ny6migfq]THIS LINE [/b:ny6migfq] oRecordSet:Fields( aWAData[WA_FIELDRECNO] ):Properties("Optimize") := 1 ENDIF FUNCTION Filter2Sql(nArea,cTableName,cFiltro) THIS LINE; [b:ny6migfq]IN[/b:ny6migfq] if substr(cfiltro,at(alltrim(upper((cAliasCorr)->(fieldname(n)))),cfiltro)-1,1) in " (),.##%$=<>" Next, SET ADO DEFAULT DATABASE command does not work with Access. Next, in this code I get error at USE command: [quote:ny6migfq] Error description: Error DBCMD/1005 Argument error: DBUSEAREA Stack Calls =========== Called from: => DBUSEAREA( 0 ) Called from: lucas.prg => MAIN( 43 ) [/quote:ny6migfq] Test sample: [code=fw:ny6migfq]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd<span style="color: #000000;">\a</span>dordd.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd<span style="color: #000000;">\a</span>dordd.prg"</span><br /><br /><br /><br />REQUEST ADORDD<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aArray := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br /><br />&nbsp; &nbsp;RDDSETDEFAULT<span style="color: #000000;">&#40;</span> &nbsp; <span style="color: #ff0000;">"ADORDD"</span> &nbsp; <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//SET ADO DEFAULT DATABASE TO "test2.mbd" &nbsp;ENGINE TO "ACCESS"</span><br /><br />&nbsp; &nbsp;ADODEFAULTS<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"test2.mbd"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"ACCESS"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, .f. <span style="color: #000000;">&#41;</span>&nbsp; &nbsp; <span style="color: #B900B9;">//FUNCTION ADODEFAULTS( cDB, cServer, cEngine, cUser, cPass,lGetThem )</span><br /><br />&nbsp; &nbsp;SET ADO <span style="color: #00C800;">DEFAULT</span> RECNO FIELD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"HBRECNO"</span><br /><br />&nbsp; &nbsp;SET AUTOPEN OFF<br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !FILE<span style="color: #000000;">&#40;</span> &nbsp; <span style="color: #ff0000;">"test2.mdb"</span> &nbsp; <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; DbCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"test2.mdb;table1"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"FIRST"</span>, &nbsp; <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"LAST"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"AGE"</span>, &nbsp; &nbsp; <span style="color: #ff0000;">"N"</span>, &nbsp;<span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"ADORDD"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><br /><br />&nbsp; &nbsp;USE TABLE1 <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"TEST2"</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//SET INDEX TO TEST1</span><br /><br />&nbsp; &nbsp;XBROWSER FASTEDIT<br /><br /><br />&nbsp; &nbsp;APPEND BLANK<br />&nbsp; &nbsp;test2->First &nbsp; := <span style="color: #ff0000;">"HOMER si no Homer"</span><br />&nbsp; &nbsp;test2->Last &nbsp; &nbsp;:= <span style="color: #ff0000;">"Simpson"</span><br />&nbsp; &nbsp;test2->Age &nbsp; &nbsp; := <span style="color: #000000;">45</span><br /><br />&nbsp; &nbsp;APPEND BLANK<br />&nbsp; &nbsp;test2->First &nbsp; := <span style="color: #ff0000;">"aaa Lara"</span><br />&nbsp; &nbsp;test2->Last &nbsp; &nbsp;:= <span style="color: #ff0000;">"Croft si no"</span><br />&nbsp; &nbsp;test2->Age &nbsp; &nbsp; := <span style="color: #000000;">32</span><br /><br /><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;DbCloseAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />&nbsp;</div>[/code:ny6migfq]
ADO RDD xHarbour
Lucas, Sorry my mistake with the version posted. Here is the correct one <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m -->. You should ow be able to run tryadordd.
ADO RDD xHarbour
Antonio, Mr Rao, Im having a problem with Numeric fields Len and Dec. Ive found this in adofuncs.prg: Max( 19, oField:Precision + 2 ) What does it mean? NumrericScale = Nr of decimal places Precision = Total field len numfield N 11 4 Precision = 11 NumericScale = 4 Len = 11 Dec = 4 Making numeric fields for calculations it round always decimals to 0 although field len and dec are correct. What can we do?
ADO RDD xHarbour
Antonio, I don´t understand the change in LOCATES: IF RDDSNAME() = "ADORDD" hb_adoSetLocateFor( "pessoa = "+"'"+(MeuNome())+"'") [b:24kjbi6a] locate for "pessoa = "+"'"+(MeuNome())+"'" [/b:24kjbi6a] ELSE ... We have to keep LOCATE FOR as DBFCDX, so not to use hb_adoSetLocateFor. Or provide it for complex locating, but not for ordinary use. If we have to start changing code, there is no RDD compilant. Thank you.
ADO RDD xHarbour
Lucas, Please remember: hb_adoSetLocateFor is needed as LOCATE calls in adordd: ADO_SETLOCATE( nWA, aScopeInfo ) ADO_LOCATE( nWA, lContinue ) Unfortunately aScopeInfo doesnt supply the cFor condition only bFor condition thus we need to set it up before with hb_adoSetLocateFor. Let me check what we can do.
ADO RDD xHarbour
Antonio, Thnak you for your attention. At least, it should support LOCATE FOR Upper(FIELD->City) = Upper(cCity).
ADO RDD xHarbour
Lucas, I ve just recheck it and I dont see any other alternative. You have to consider : LOCATE FOR Upper(FIELD->City) = Upper(cCity). This s passed to ADO_SETLOCATE in aScopeInfo as a code block. We need hb_adoSetLocateFor to have it as a string. But another problem is the hb_adoSetLocateFor( <(for)> ) (adordd.ch) needs to receive it as a string: " Upper(FIELD->City) = Upper(cCity)" This cant be evaluated because the variables are out of scope at ado framework. This we must sent as for other rdds like ADS with the value of that var and not the var itself thus you will have to do: "Upper(FIELD->City) ="+"'"+ Upper(cCity)+"'" Then the string would be: Upper(FIELD->City) ='LONDON' The same will happen in index expressions with vars. Sorry there isnt any other way. For us no problem because the app worked already with ADS and it was already doing that. Nevertheless this should not be a problem because its a very fast change in the app code and does not break any logic of it that's why I proposed the foloowing way of change it: IF RDDSNAME() = "ADORDD" //NEW EXPRESSIONS FOR ADO ELSE //AS ALREADY WRITTEN CODE ENDIF
ADO RDD xHarbour
[quote:qzd5tovk] Antonio, Mr Rao, Im having a problem with Numeric fields Len and Dec. [/quote:qzd5tovk] Solved !
ADO RDD xHarbour
Lucas, Locate works now exactly the same as for dbfcdx and others. No need to alter anything in the code. I choose to eval(bBlock) in do while performance its almost the same as with find. Ill post new version today.
ADO RDD xHarbour
Antonio, Did you really fixed LOCATE FOR... command?. That´s a great news!. Also, there is a mistake on this line: FUNCTION ADO_OPEN( nWA, aOpenInfo ) [b:3qymatxo] oRecordSet:Fields( aWAData[WA_FIELDRECNO] ):Properties("Optimize") := 1[/b:3qymatxo] Thank you.
ADO RDD xHarbour
Lucas, Im still solving some problem with LOCATE . [code=fw:1shukdqz]<div class="fw" id="{CB}" style="font-family: monospace;">oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Properties</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Optimize"</span><span style="color: #000000;">&#41;</span> := <span style="color: #000000;">1</span></div>[/code:1shukdqz] What is the mistake ? Compile ? With xHarbour ok.
ADO RDD xHarbour
Antonio, It says: adordd\adordd.prg(278) Error E0022 Invalid lvalue ':'
ADO RDD xHarbour
Lucas, I have no idea why that error. Here its ok. Is that a compile error? I posted new adordd.prg and .ch with LOCATE ready. <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Now you dont need to alter anything <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> I have some funny problem here but I dont know if it is caused by new LOCATE. Please check it yourself.
ADO RDD xHarbour
Antonio, Thank you. What sort of new problems did you find?.
ADO RDD xHarbour
I am moving our disucssions to this thread to keep them at one main place. You said: [quote:2h6acl7o] (ownd:numera)->dataultmov is 28/04/15 dDataM is 28/04/15 if (ownd:numera)->dataultmov > dDataM msginfo("Data do ult doc "+dtoc((ownd:numera)->dataultmov)+CRLF+; "Data deste doc "+dtoc(dDataM) ) endif The code inside the IF should never be executed but it is and the msginfo shows both with the same date 28.04.15. What might be the reason? [/quote:2h6acl7o] First recommended caution is to keep always Century on. Most date fields in various SQL servers store acutally date-time values, not pure truncated date values. Please keep in mind that I said "most" not "all". If for some reasons, the value stored in the field is 28/04/2015 00:00:00.001 then this field value is greater than pure date 28/04/2015. Years back I struggled till I found that xHarbour was adding one extra milli second. ( I do not know if this is ok now) We need to be extra-cautious while dealing with dates in sql databases. For the purpose of ADORDD, please return truncated date ( with valtype 'D') when the FieldType is "D" and full value with valtype 'T' when the field type is 'T'. I suggest you return FW_TTOD( <fieldvalue> ) when the FieldType is 'D' and FW_DTOT( <fieldvalue> ) when the field value is 'T'. We use this in our XBrowse, TDataRow and TRecSet so that users are insulated from this behavior. We need to keep this in mind when preparing SQL statements comparing Dates. For example, SELECT * WHERE INVDT BETWEEN '2015-04-01' AND '2015-04-30' may totally exclude all transactions that took place on 30th Apr 2015. Because this is actually translated as INVDT >= '2015-04-01 00:00:00' and INVDT <= '2015-04-30 00:00:00'. Naturally this query ignores transactions from '2015-04-30 00:00:00.001' till '2015-04-30 23:59:59.999' This is just an example to show how deceptive can be date comparisons. In addition MS Sql server has a very awkward habit of storing '2014-04-01' internally as '2014-04-01 12:00:00' in the field. So, the safer construct is SELECT * WHERE INVDT >= '2015-04-01' AND INVDT < '2015-05-01'. I still see many amatuers committing this mistake which turns out to be a blunder in real life situations. I hope if you keep this points in mind, everything will work as expected.
ADO RDD xHarbour
You said in the other thread. [quote:2sov47l7]I´ve tested it and it works perfectly with adUseclient and adUserServer cursors. [/quote:2sov47l7] Glad to know it is working well with both client and server-side. Please see for reference: <!-- m --><a class="postlink" href="https://msdn.microsoft.com/en-us/library/ee252458(v=bts.10">https://msdn.microsoft.com/en-us/librar ... 8(v=bts.10</a><!-- m -->).aspx "https://msdn.microsoft.com/en-us/library/ee252458(v=bts.10).aspx" Extracts: [quote:2sov47l7] adLockPessimistic 2 This value indicates pessimistic locking, record by record. The provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately after editing. This lock type is supported by the Microsoft® OLE DB Provider for AS/400 and VSAM and the Microsoft OLE DB Provider for DB2. However, the OLE DB Provider for AS/400 and VSAM internally maps this lock type to adLockBatchOptimistic. [/quote:2sov47l7] and [quote:2sov47l7] The adLockPessimistic setting is not supported if the CursorLocation property is set to adUseClient. If an unsupported value is set, then no error will result; the closest supported LockType will be used instead. [/quote:2sov47l7] You said: [quote:2sov47l7] So we never call :Update() in ADO_PUTVALUE and ADO_APPEND and the :Update is then called only ADO_UNLOCK. Right? [/quote:2sov47l7] Good Idea. [quote:2sov47l7] The app Im converting gets all the new records an locks and then goes through the Locklist array of each table processing each replace. Since we move the record we lost the physical lock right? [/quote:2sov47l7] Yes. It appears multi-record locking does not seem possible in ADO. Anyway you need to keep experimenting more on this, simultaneously working as two users on the same table. [quote:2sov47l7] Starting a transaction can eliminate this ? [/quote:2sov47l7] Transactions and locking are two different things altogether. All updates within one transaction block either they get written or abandoned but never written partially. Normally used for multi-table updataions with the same connection. Talking about transactions, they work for a single connection. If we open recordsets with connection string each of them will get a separate connection.
ADO RDD xHarbour
[quote:3hrj2j4i]I suggest you return FW_TTOD( <fieldvalue> ) when the FieldType is 'D' and FW_DTOT( <fieldvalue> ) when the field value is 'T'. We use this in our XBrowse, TDataRow and TRecSet so that users are insulated from this behavior. [/quote:3hrj2j4i] I dont have these functions. Can you post them here? [quote:3hrj2j4i]So, the safer construct is SELECT * WHERE INVDT >= '2015-04-01' AND INVDT < '2015-05-01'. I still see many amatuers committing this mistake which turns out to be a blunder in real life situations.[/quote:3hrj2j4i] To avoid apps code change then we could do it: SELECT * WHERE INVDT BETWEEN '2015-04-01'+'00:00:00:000' AND '2015-04-30'+'23:59:59.999' adding the time part to the date at adordd. Resuming we always add at adordd the time part of the date like that. Right? Thanks so much for your help and expertise.
ADO RDD xHarbour
[quote:f0elt87e]Glad to know it is working well with both client and server-side. [/quote:f0elt87e] It works in the sense of the locking (with 2 users the 2nd cannot edit) but changing order focus we build a new recordset with the order by clause and closing the current one throws an error. Also if we get the locks and move to other records we loose it. I think the only alternative is to have another field or a table to do it but we still didn't find how. Do you have any idea? Also using adUseclient seems not to work ok with our browses. adUseServer ok. But adUseServer doesnt work with Browse() in ACCESS. Dont know why.
ADO RDD xHarbour
[quote="lucasdebeltran":3jx6apyu]Antonio, Thank you. What sort of new problems did you find?.[/quote:3jx6apyu] Please check ADO_LOCATE. If we call successive locates although it goes through the records correctly in the do while it does not evaluate the block to .t. after the first time. Please try: [code=fw:3jx6apyu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> n < <span style="color: #000000;">20</span><br />&nbsp; &nbsp; locate <span style="color: #00C800;">for</span> whateverfield = whatevervalue <span style="color: #B900B9;">// existing in the table</span><br />&nbsp; &nbsp; <span style="color: #00C800;">if</span> found<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"found()"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"not found()"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; n++<br /><span style="color: #00C800;">enddo</span><br />&nbsp;</div>[/code:3jx6apyu] Now if you place a browse() just after locate it goes ok. Can you see it? We are looking for a explanation. Antonio, Mr Rao, do you have some clue?
ADO RDD xHarbour
Antonio, I just sent an email to Mr. Rao asking him
ADO RDD xHarbour
New adordd version with working locking as dbfs at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> This is still on trial and its working quite well on heavy transactions many records in many tables. It assures completely record locking and concurrent access control like any other rdd. The drawback is that we must use a dbf table in a network share with another rdd for this to work. Its very small recsize only 50b and has a recycle scheme for records not needed. Still have some issues with dates and NULL values in adordd.
ADO RDD xHarbour
Antonio, Any news regarding date functions? Now Im taking care of : copy to (cfile) WHILE .... This function calls ADO_APPEND but the nWA received its a new one. Probably this function selects a new area to copy file to. Can we somehow change it or do we have to write a replacement from scratch. Where can I find this function?
ADO RDD xHarbour
Antonio, [code=fw:2745cf51]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> FW_TTOD <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retdl<span style="color: #000000;">&#40;</span> hb_pardl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> FW_DTOT <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br />#ifdef __XHARBOUR__<br />&nbsp; &nbsp;hb_retdtl<span style="color: #000000;">&#40;</span> hb_pardl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, hb_part<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />#else<br />&nbsp; &nbsp;long lJulian;<br />&nbsp; &nbsp;long lMilliSecs;<br /><br />&nbsp; &nbsp;hb_partdt<span style="color: #000000;">&#40;</span> &lJulian, &lMilliSecs, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_rettdt<span style="color: #000000;">&#40;</span> lJulian, lMilliSecs <span style="color: #000000;">&#41;</span>;<br />#endif<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br />&nbsp;</div>[/code:2745cf51]
ADO RDD xHarbour
Antonio, Thanks for the code. adordd its working almost perfectly. Antonio, Mr Rao, But I've still 2 pending problems: 1) Fields N without any decimal returning 2 decimals. (xxx.00) Do you have any idea what might be the problem. 2) Locates. Can you check the adordd.prg ado_locate to see what might be the problem? If we do : [code=fw:3aktb8z7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #000000;">&#40;</span>calias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>__dblocate<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span>|| namefiled->name = cNname<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3aktb8z7] The first time found following times not found. Have you tried adordd?
ADO RDD xHarbour
Antonio, [quote:3fh3rpc1]1) Fields N without any decimal returning 2 decimals. (xxx.00) Do you have any idea what might be the problem.[/quote:3fh3rpc1] Do you use any C code ? if yes then check if hb_retnd() is used somewhere and change it into hb_retnl()
ADO RDD xHarbour
Antonio, [quote:rh3f8fyr]2) Locates. Can you check the adordd.prg ado_locate to see what might be the problem?[/quote:rh3f8fyr] Surely you need to do a oRecordSet:GoTop() before running the locate code.
ADO RDD xHarbour
Antonio, [quote="Antonio Linares":1xfkv8ey]Antonio, [quote:1xfkv8ey]2) Locates. Can you check the adordd.prg ado_locate to see what might be the problem?[/quote:1xfkv8ey] Surely you need to do a oRecordSet:GoTop() before running the locate code.[/quote:1xfkv8ey] xHarbour help [quote:1xfkv8ey] <Scope> This option defines the number of records to scan. It defaults to ALL. The NEXT <nCount> scope scans the next <nCount> records, while REST scans records beginning from the current record to the end of file. The search begins with the first record unless a scope is defined. [/quote:1xfkv8ey] ADO_LOCATE code [code=fw:1xfkv8ey]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_LOCATE<span style="color: #000000;">&#40;</span> nWA, lContinue <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aWAData := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oRecordSet := aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ADOEMPTYSET<span style="color: #000000;">&#40;</span>oRecordSet<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_FAILURE<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !lContinue <br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//START FROM BEGINING</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//WE DONT WANT TO FIND THIS ONE AGAIN</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;CURSORWAIT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !oRecordSet:<span style="color: #000000;">EoF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>b<span style="color: #000000;">&#93;</span><span style="color: #00C800;">IF</span> EVAL<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_SCOPEINFO <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> UR_SI_BFOR <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span>/b<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_FOUND <span style="color: #000000;">&#93;</span> := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EXIT<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span>&nbsp; <br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; SYSREFRESH<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br />&nbsp; &nbsp;CURSORARROW<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_FOUND <span style="color: #000000;">&#93;</span> := ! oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">EOF</span><br />&nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp;</div>[/code:1xfkv8ey] Somehow the eval() doesn't return .t. although is passing the record where it should.
ADO RDD xHarbour
[quote="Antonio Linares":8i9n31ii]Antonio, [quote:8i9n31ii]1) Fields N without any decimal returning 2 decimals. (xxx.00) Do you have any idea what might be the problem.[/quote:8i9n31ii] Do you use any C code ? if yes then check if hb_retnd() is used somewhere and change it into hb_retnl()[/quote:8i9n31ii] No hb_retnd() . But if I used it and worked with other rdds should work also with adordd. Any other idea?
ADO RDD xHarbour
Antonio, Try this: (calias)->(__dblocate( {|| MsgInfo( namefiled->name, cNname ), namefiled->name = cNname} )) And check what it shows > Fields N without any decimal returning 2 decimals. (xxx.00) Try to check the size of the field and use int() when its not a decimal
ADO RDD xHarbour
Antonio, Mr Rao, [quote:2opahsr4]Try to check the size of the field and use int() when its not a decimal[/quote:2opahsr4] Solved! In adofuncs.prg you have: [code=fw:2opahsr4]<div class="fw" id="{CB}" style="font-family: monospace;"> nLen &nbsp; &nbsp; := &nbsp;<span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">19</span>, oField:<span style="color: #000000;">Precision</span> + <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> &nbsp;</div>[/code:2opahsr4] Shouldnt it be: [code=fw:2opahsr4]<div class="fw" id="{CB}" style="font-family: monospace;"> nLen &nbsp; &nbsp; := <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">19</span>, oField:<span style="color: #000000;">Precision</span> &nbsp;<span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #B900B9;">//</span></div>[/code:2opahsr4] Otherwise we will have all fields much bigger because the minimum it will be 19. Why not only oField:Precision?
ADO RDD xHarbour
Antonio, [quote:dlbjhat0](calias)->(__dblocate( {|| MsgInfo( namefiled->name, cNname ), namefiled->name = cNname} )) And check what it shows[/quote:dlbjhat0] It seems after 1st time a loose the codeblock I checking why.
ADO RDD xHarbour
[quote="AHF":rcb5b8vw]Antonio, Mr Rao, [quote:rcb5b8vw]Try to check the size of the field and use int() when its not a decimal[/quote:rcb5b8vw] Solved! In adofuncs.prg you have: [code=fw:rcb5b8vw]<div class="fw" id="{CB}" style="font-family: monospace;"> nLen     :=  <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">19</span>, oField:<span style="color: #000000;">Precision</span> + <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>  </div>[/code:rcb5b8vw] Shouldnt it be: [code=fw:rcb5b8vw]<div class="fw" id="{CB}" style="font-family: monospace;"> nLen     := <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">19</span>, oField:<span style="color: #000000;">Precision</span>  <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">//</span></div>[/code:rcb5b8vw] Otherwise we will have all fields much bigger because the minimum it will be 19. Why not only oField:Precision?[/quote:rcb5b8vw] Thanks. I am correcting Max to Min in adofuncs.prg. +2 is for ( 1 decimal place and 1 minus sign )
ADO RDD xHarbour
Lucas, Always both with same size an order. One for ado framework the other for all usual index functions to work correctly. The SET ADODBF TABLES INDEX LIST TO must follow the (x)Harbour usual syntax. The SET ADO TABLES INDEX LIST TO its for SQL it might even contain SQL functions.
ADO RDD xHarbour
New version adordd at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Locks and exclusive use working. Dates and numbers working. Locates working. Any app code change required. Just Link it.
ADO RDD xHarbour
Great job Antonio! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Mr Rao, [quote:joq2j8lc]+2 is for ( 1 decimal place and 1 minus sign )[/quote:joq2j8lc] In dbf when we say field,"N" ,11,4 the total length f the field is 11 but in fact one is taken for the "." decimal so we only have 6,4 and if we want a minus we only have 5,4. Shouldn't we use the same criteria in adordd ? Besides that if we create a field, "N", 10 ,2 in ACCESS in adofuncs it is considered as "MONEY" why?
ADO RDD xHarbour
Antonio, Money must be used with 2 decimals because there is a bug with Access.
ADO RDD xHarbour
Lucas, Ok thanks. How are you trials going?
ADO RDD xHarbour
Antonio, I am waiting for last version with locates, dates and Numbers fixed. Thank you.
ADO RDD xHarbour
Antonio, Im taking care of exclusive use but throwing the error doesnt do nothing the program just continues. The same if oRecordSet in NIL What might be the problem? [code=fw:p6w24av0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #B900B9;">//OPEN EXCLUSIVE </span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !aWAData<span style="color: #000000;">&#91;</span> WA_OPENSHARED <span style="color: #000000;">&#93;</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;aLockInfo<span style="color: #000000;">&#91;</span> UR_LI_METHOD <span style="color: #000000;">&#93;</span> := DBLM_EXCLUSIVE<br />&nbsp; &nbsp; &nbsp; &nbsp;aLockInfo<span style="color: #000000;">&#91;</span> UR_LI_RESULT <span style="color: #000000;">&#93;</span> := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp;ADO_LOCK<span style="color: #000000;">&#40;</span> nWA, aLockInfo <span style="color: #000000;">&#41;</span>&nbsp; &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> !aLockInfo<span style="color: #000000;">&#91;</span> UR_LI_RESULT <span style="color: #000000;">&#93;</span><br /><br /><span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ERROR ADOPEN"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//IT COMES HERE BUT DO NOTHING ! WHY?</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oError := ErrorNew<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">GenCode</span> := EG_OPEN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">SubCode</span> := <span style="color: #000000;">1001</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">Description</span> := hb_langErrMsg<span style="color: #000000;">&#40;</span> EG_OPEN <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">FileName</span> := aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">OsCode</span> := <span style="color: #000000;">0</span> <span style="color: #B900B9;">// TODO </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">CanDefault</span> := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NETERR<span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UR_SUPER_ERROR<span style="color: #000000;">&#40;</span> nWA, oError <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_FAILURE&nbsp;&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span>&nbsp; &nbsp; &nbsp; &nbsp;<br /><br />&nbsp; &nbsp;oRecordSet := &nbsp;TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> oRecordSet == <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; oError := ErrorNew<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">GenCode</span> := EG_OPEN<br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">SubCode</span> := <span style="color: #000000;">1001</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">Description</span> := hb_langErrMsg<span style="color: #000000;">&#40;</span> EG_OPEN <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">FileName</span> := aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">OsCode</span> := <span style="color: #000000;">0</span> <span style="color: #B900B9;">/* TODO */</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">CanDefault</span> := .T.<br /><br />&nbsp; &nbsp; &nbsp; UR_SUPER_ERROR<span style="color: #000000;">&#40;</span> nWA, oError <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_FAILURE<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp;</div>[/code:p6w24av0]
ADO RDD xHarbour
Antonio, What are the differences between SET ADO TABLES INDEX LIST TO and SET ADODBF TABLES INDEX LIST TO?. Tryadordd.prg explanation is not clear. Also, in last versión locking does not work. Also, OrdSetFocus() fails too. I suggest you to try with XBROWSER FASTEDIT. With this command, you will be able to add, modify, delete records... etc and you will be able to find bugs. Thank you.
ADO RDD xHarbour
Lucas, Please check your version.ADOVERSION() in adordd and inform. SET ADO TABLES INDEX LIST TO these are the indexes for adordd without any dbf expressions for ado framework Ex index expression "date+nrcod+id" SET ADODBF TABLES INDEX LIST TO are the indexes with dbf expressions as you use in your dbf application Ex index expression "dtos(date)+str(nrcod)+id" Dont forget that the ADODBF are the index expressions to be evaluated like Indexkey() or &(indexkey())and all index functions. Locking should be working although with some bugs now corrected. It was not releasing all locks. If you dont have any autoinc field indicated to adordd you will get problems. Orsetfocus() is already working ok since the last couple of verions. We ve using it without any errors. Could you post the error and the index expression? I dont work with xbBrowse in this app and I dont have it. Ill post a new version today working ok with: Dates and numbers Exclusive use Locking Missing to do: append from copy to
ADO RDD xHarbour
Antonio, So SET ADO TABLES INDEX LIST TO and SET ADODBF TABLES INDEX LIST TO must be defined both or just one?. I will recheck with today´s new version. Thank you.
ADO RDD xHarbour
Antonio, Thanks, Now its only missing: APPEND FROM COPY TO What are the rdd functions for this? Also what is the porpose of HB_DBDROP HB_DBRENAME? Its ily for sql? How do you call it from app?
ADO RDD xHarbour
Antonio, I need your help. What are these doing? /* non WorkArea functions */ #define UR_INIT this I know! #define UR_EXIT 95 #define UR_DROP = ADO_DROP (DROP TABLE OR INDEX) #define UR_EXISTS = ADO_EXISTS (TABEL EXIST?) #define UR_RENAME 98 #define UR_RDDINFO This I kow In previous version of adordd from Fernando and Miguel they are redirected to ado_. I think these are rdd driver related functions so that redirection is wrong. Can you confirm?
ADO RDD xHarbour
Antonio, You have to check how those commands are translated: [quote:5wcw9ss0]#command APPEND [FROM <(f)>] [FIELDS <fields,...>] ; [FOR <for>] [WHILE <while>] [NEXT <next>] ; [RECORD <rec>] [<rest:REST>] [ALL] ; [DELIMITED [WITH <*delim*>]] [CODEPAGE <cp>] => ; __dbDelim( .F., <(f)>, <(delim)>, { <(fields)> }, ; <{for}>, <{while}>, <next>, <rec>, <.rest.>, <cp> )[/quote:5wcw9ss0] Now look in Harbour source code for __dbDelim() code
ADO RDD xHarbour
It is finally redirected to HB_FUNC( __DBTRANS ): ... errCode = SELF_TRANS( dbTransInfo.lpaSource, &dbTransInfo );
ADO RDD xHarbour
Antonio, Have you look for those UR_ defines in all Harbour sources ?
ADO RDD xHarbour
Antonio, Thanks
ADO RDD xHarbour
[quote="Antonio Linares":3dmqkpu5]Antonio, Have you look for those UR_ defines in all Harbour sources ?[/quote:3dmqkpu5] Yes. In dbcmd.c [code=fw:3dmqkpu5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> HB_DBDROP <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;LPRDDNODE &nbsp;pRDDNode;<br />&nbsp; &nbsp;HB_USHORT &nbsp;uiRddID;<br />&nbsp; &nbsp;HB_ULONG &nbsp; ulConnection;<br />&nbsp; &nbsp;const char * szDriver;<br />&nbsp; &nbsp;PHB_ITEM &nbsp; pName;<br /><br />&nbsp; &nbsp;szDriver = hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> !szDriver <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">/* no VIA RDD parameter, use default */</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; szDriver = hb_rddDefaultDrv<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NULL</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;ulConnection = hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;pRDDNode = hb_rddFindNode<span style="color: #000000;">&#40;</span> szDriver, &uiRddID <span style="color: #000000;">&#41;</span>; &nbsp;<span style="color: #B900B9;">/* find the RDDNODE */</span><br />&nbsp; &nbsp;pName = hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, HB_IT_STRING <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pRDDNode && pName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; hb_retl<span style="color: #000000;">&#40;</span> SELF_DROP<span style="color: #000000;">&#40;</span> pRDDNode, pName, hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, HB_IT_STRING <span style="color: #000000;">&#41;</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ulConnection <span style="color: #000000;">&#41;</span> == HB_SUCCESS <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; hb_errRT_DBCMD<span style="color: #000000;">&#40;</span> EG_ARG, EDBCMD_EVAL_BADPARAMETER, <span style="color: #00C800;">NULL</span>, HB_ERR_FUNCNAME <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> HB_DBEXISTS <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;LPRDDNODE &nbsp;pRDDNode;<br />&nbsp; &nbsp;HB_USHORT &nbsp;uiRddID;<br />&nbsp; &nbsp;HB_ULONG &nbsp; ulConnection;<br />&nbsp; &nbsp;const char * szDriver;<br />&nbsp; &nbsp;PHB_ITEM &nbsp; pName;<br /><br />&nbsp; &nbsp;szDriver = hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> !szDriver <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">/* no VIA RDD parameter, use default */</span><br />&nbsp; &nbsp; &nbsp; szDriver = hb_rddDefaultDrv<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NULL</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;ulConnection = hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;pRDDNode = hb_rddFindNode<span style="color: #000000;">&#40;</span> szDriver, &uiRddID <span style="color: #000000;">&#41;</span>; &nbsp;<span style="color: #B900B9;">/* find the RDD */</span><br />&nbsp; &nbsp;pName = hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, HB_IT_STRING <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pRDDNode && pName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; hb_retl<span style="color: #000000;">&#40;</span> SELF_EXISTS<span style="color: #000000;">&#40;</span> pRDDNode, pName, hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, HB_IT_STRING <span style="color: #000000;">&#41;</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ulConnection <span style="color: #000000;">&#41;</span> == HB_SUCCESS <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; hb_errRT_DBCMD<span style="color: #000000;">&#40;</span> EG_ARG, EDBCMD_EVAL_BADPARAMETER, <span style="color: #00C800;">NULL</span>, HB_ERR_FUNCNAME <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:3dmqkpu5] It seems to me that this has to do with rdddriver and not table. I think we dont need this. Right?
ADO RDD xHarbour
Antonio, It looks like a cleaning on exit if needed. If you don't need it to clean anything, then you don't need it.
ADO RDD xHarbour
Hello, Is not working. I get this error: Error description: Error BASE/1081 Argument error: + Args: [ 1] = U [ 2] = C .DBF Stack Calls =========== Called from: test.prg => ADO_OPENSHARED( 2670 ) _ > DBUSEAREA(.T.,aLockCtrl[2],aLockCtrl[1]+".DBF","TLOCKS",.T.) Called from: test.prg => ADO_OPEN( 241 ) Called from: => DBUSEAREA( 0 ) Called from: test.prg => MAIN( 59 ) Is anyone testing this?. It seems that no...
ADO RDD xHarbour
Elvira, Please post here test.prg
ADO RDD xHarbour
Antonio, I'm working "copy to" but guessing what to do because there isn't any documentation. Please inform what is in aFieldsStru I see some code blocks but I have no idea what it is. __dbTrans( nDstArea, aFieldsStru, bFor, bWhile, nNext, nRecord, lRest ) are these parameters correcto for UR_TRANS? Also parameters for UR_TRANSREC and what is for.
ADO RDD xHarbour
Sure, #include "fivewin.ch" #include "adordd.prg" REQUEST ADORDD function Main() RDDSETDEFAULT( "ADORDD" ) SET ADODBF TABLES INDEX LIST TO {{ "TEST", {"TEST1", "FIRST"} ,; {"TEST2", "LAST"} ,; {"TEST3", "AGE"} }} SET ADO TABLES INDEX LIST TO {{ "TEST", {"TEST1", "FIRST"} ,; {"TEST2", "LAST"} ,; {"TEST3", "AGE"} }} SET ADO DEFAULT RECNO FIELD TO "HBRECNO" SET AUTOPEN ON //might be OFF if you wish SET AUTORDER TO 1 // first index opened can be other SET ADO DEFAULT DATABASE TO "TEST2.mdb" ENGINE TO "ACCESS" USER TO "" PASSWORD TO "" SET ADO LOCK CONTROL SHAREPATH TO "C:\" RDD TO "DBFCDX" IF !FILE( "test2.mdb" ) DbCreate( "test2.mdb;table1", { { "FIRST", "C", 30, 0 },; { "LAST", "C", 30, 0 },; { "AGE", "N", 8, 0 } }, "ADORDD" ) ENDIF USE TABLE1 NEW ALIAS "TEST2" TEST2->( OrdSetFocus("TEST2") ) msginfo(ordsetfocus()) DbGoTop() XBROWSER FASTEDIT DbCloseAll() return nil
ADO RDD xHarbour
Elvira, Please try: SET ADO LOCK CONTROL SHAREPATH TO "C:" RDD TO "DBFCDX" //cant use final "\" SET ADO TABLES INDEX LIST and SET ADODBF TABLES INDEX LIST TO the name is of the table not the alias. And add HB_RECNO when creating the tables. This field its not auto creates by ado. Please let me know result. Thanks
ADO RDD xHarbour
Antonio, I did those changes, and I still get: Time from start: 0 hours 0 mins 0 secs Error occurred at: 05/05/15, 13:53:30 Error description: Error DBCMD/1015 Argument error: DBUSEAREA Stack Calls =========== Called from: => DBUSEAREA( 0 ) Called from: test.prg => ADO_OPENSHARED( 2670 ) -> DBUSEAREA(.T.,aLockCtrl[2],aLockCtrl[1]+".DBF","TLOCKS",.T.) By the way, in order to have ADORDD more clear, SET ADO LOCK CONTROL SHAREPATH should be by default HBDIRBASE(), without needing to specify it. The same for SET ADO DEFAULT RECNO FIELD. Thank you.
ADO RDD xHarbour
Elvira, Are you linking dbfcdx rdd ? What version are you using see adoversion please. Whats this HBDIRBASE ? Im using xHarbour.
ADO RDD xHarbour
Antonio, I am using "AdoRdd Version 1.040515/1" I linked DBFCDX and now I get another error: Error description: Error ADORDD/1022 Lock required: TABLE1 Stack Calls =========== Called from: => UR_SUPER_ERROR( 0 ) Called from: test.prg => ADO_PUTVALUE( 1276 ) Called from: test.prg => MAIN( 72 ) And also: Error description: Error ADORDD/1022 Lock required: TABLE1 Stack Calls =========== Called from: => UR_SUPER_ERROR( 0 ) Called from: test.prg => ADO_DELETE( 1068 ) Called from: => DBDELETE( 0 ) Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE_SETRDD( 4153 ) Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE( 632 ) Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DELETE( 0 ) Called from: .\source\function\XBROWSER.PRG => (b)XBROWSE( 137 ) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 522 ) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 752 ) Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1723 ) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1601 ) Called from: .\source\classes\WINDOW.PRG => _FWH( 3345 ) Called from: => DIALOGBOXINDIRECT( 0 ) Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 286 ) Called from: .\source\function\XBROWSER.PRG => XBROWSE( 220 ) Called from: test.prg => MAIN( 68 ) hb_dirbase() is [code=fw:2jt7viyt]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">function</span> hb_DIRBASE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> cFilePath<span style="color: #000000;">&#40;</span> GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp;</div>[/code:2jt7viyt]
ADO RDD xHarbour
Elvira, You must have HB_RECNO or other autoinc type field in your tables and indicate its name to adordd .
ADO RDD xHarbour
I do have it: SET ADO DEFAULT RECNO FIELD TO "ID"
ADO RDD xHarbour
Elvira, Please post prg.
ADO RDD xHarbour
Sure, REQUEST ADORDD, DBFCDX function Main() local aArray := {} RDDSETDEFAULT( "ADORDD" ) SET ADODBF TABLES INDEX LIST TO {{ "TEST2", {"TEST1", "FIRST"} ,; {"TEST2", "LAST"} ,; {"TEST3", "AGE"} }} SET ADO TABLES INDEX LIST TO {{ "TEST2", {"TEST1", "FIRST"} ,; {"TEST2", "LAST"} ,; {"TEST3", "AGE"} }} SET ADO DEFAULT RECNO FIELD TO "ID" SET AUTOPEN ON //might be OFF if you wish SET AUTORDER TO 1 // first index opened can be other SET ADO DEFAULT DATABASE TO "TEST2.mdb" ENGINE TO "ACCESS" USER TO "" PASSWORD TO "" SET ADO LOCK CONTROL SHAREPATH TO "C:" RDD TO "DBFCDX" IF !FILE( "test2.mdb" ) DbCreate( "test2.mdb;table1", { { "FIRST", "C", 30, 0 },; { "LAST", "C", 30, 0 },; { "AGE", "N", 8, 0 } }, "ADORDD" ) ENDIF USE TABLE1 NEW ALIAS "TEST2" TEST2->( OrdSetFocus("TEST2") ) msginfo(ordsetfocus()) XBROWSER FASTEDIT DbCloseAll() return nil
ADO RDD xHarbour
Elvira, You must do it like this: Please note table1 instead of test2 in SET ADO... TABLES as the indexes are related to tables not to DBs and ID field in dbcreate. Like this should work ok. [code=fw:1rfzumft]<div class="fw" id="{CB}" style="font-family: monospace;"><br />SET ADODBF TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">&#125;</span> ,;<br /><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">&#125;</span> ,;<br /><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br />SET ADO TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">&#125;</span> ,;<br /><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">&#125;</span> ,;<br /><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br /><br /><br />SET ADO <span style="color: #00C800;">DEFAULT</span> RECNO FIELD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ID"</span><br /><br />SET AUTOPEN <span style="color: #0000ff;">ON</span> <span style="color: #B900B9;">//might be OFF if you wish</span><br />SET AUTORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span> <span style="color: #B900B9;">// first index opened can be other</span><br /><br /><br />SET ADO <span style="color: #00C800;">DEFAULT</span> DATABASE <span style="color: #0000ff;">TO</span> CPATH+<span style="color: #ff0000;">"TEST2.mdb"</span> ENGINE <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ACCESS"</span> USER <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span> PASSWORD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span><br /><br />SET ADO LOCK CONTROL SHAREPATH <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"C:"</span> RDD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"DBFCDX"</span><br /><br /><br /><br /><span style="color: #00C800;">IF</span> !FILE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"test2.mdb"</span> <span style="color: #000000;">&#41;</span><br /><br />DbCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"test2.mdb;table1"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"LAST"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"AGE"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ID"</span> ,<span style="color: #ff0000;">"+"</span>,<span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"ADORDD"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDIF</span><br /><br />&nbsp;</div>[/code:1rfzumft]
ADO RDD xHarbour
Antonio, Thank you but it does not: [code=fw:zra8gk3o]<div class="fw" id="{CB}" style="font-family: monospace;"><br />REQUEST ADORDD, DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #00C800;">local</span> cPath := hb_dirbase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; RddRegister<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADORDD"</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />&nbsp; RddSetDefault<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADORDD"</span><span style="color: #000000;">&#41;</span><br /><br /><br />SET ADODBF TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">&#125;</span> ,;<br /><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">&#125;</span> ,;<br /><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br />SET ADO TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">&#125;</span> ,;<br /><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">&#125;</span> ,;<br /><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br /><br /><br />SET ADO <span style="color: #00C800;">DEFAULT</span> RECNO FIELD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ID"</span><br /><br />SET AUTOPEN <span style="color: #0000ff;">ON</span> <span style="color: #B900B9;">//might be OFF if you wish</span><br />SET AUTORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span> <span style="color: #B900B9;">// first index opened can be other</span><br /><br /><br />SET ADO <span style="color: #00C800;">DEFAULT</span> DATABASE <span style="color: #0000ff;">TO</span> CPATH+<span style="color: #ff0000;">"TEST2.mdb"</span> ENGINE <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ACCESS"</span> USER <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span> PASSWORD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span><br /><br />SET ADO LOCK CONTROL SHAREPATH <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"C:"</span> RDD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"DBFCDX"</span><br /><br /><br /><br /><span style="color: #00C800;">IF</span> !FILE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"test2.mdb"</span> <span style="color: #000000;">&#41;</span><br /><br />DbCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"test2.mdb;table1"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"LAST"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"AGE"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ID"</span> ,<span style="color: #ff0000;">"+"</span>,<span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"ADORDD"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDIF</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;USE table1 <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"TEST2"</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:zra8gk3o] Time from start: 0 hours 0 mins 0 secs Error occurred at: 05/05/15, 16:27:09 Error description: (DOS Error -2147352567) WINOLE/1007 The database engine Microsoft Jet can not find the input table or query 'TABLE1'. Make sure it exists and that its name is spelled correctly. (0x80040E37): Microsoft JET Database Engine Args: [ 1] = C SELECT * FROM TABLE1 [ 2] = O ADODB.Connection Stack Calls =========== Called from: => TOLEAUTO:OPEN( 0 ) Called from: elvira.prg => ADO_OPEN( 295 ) Called from: => DBUSEAREA( 0 ) Called from: elvira.prg => MAIN( 58 ) Thanks <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->.
ADO RDD xHarbour
Elvira, Its a bug ! Take out test2.mdb; from dbcreate. DbCreate( "table1", { { "FIRST", "C", 30, 0 },; { "LAST", "C", 30, 0 },; { "AGE", "N", 8, 0 },; { "ID" ,"+",10, 0} }, "ADORDD" ) Im correcting it but like this its working here. Let me know if it worked. Thanks.
ADO RDD xHarbour
Elvira, If you want keep things the same way please replace in adordd in function ado_create IF( ALLTRIM( cDataBase ) == "" ,cDataBase:= t_cDataSource, cDataBase ) IF( ALLTRIM( cTable ) == "" , cTable := aOpenInfo[ UR_OI_NAME ] ,cTable) IF( ALLTRIM( cDbEngine ) == "" ,cDbEngine:= t_cEngine, cDbEngine ) IF( ALLTRIM( cServer ) == "" , cServer:= t_cServer, cServer ) IF( ALLTRIM( cUserName ) == "" , cUserName:= t_cUserName, cUserName ) IF( ALLTRIM( cPassword ) == "" , cPassword:= t_cPassword, cPassword ) Please note difference = to == That s it.
ADO RDD xHarbour
Antonio, Now I get: Error description: Error ADORDD/1022 Lock required: TABLE1 Stack Calls =========== Called from: => UR_SUPER_ERROR( 0 ) Called from: elvira.prg => ADO_PUTVALUE( 1276 ) Called from: elvira.prg => MAIN( 76 ) I also tried with the EXCLUSIVE at USE: <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: --> USE table1 ALIAS "TEST2" NEW EXCLUSIVE Also, how do I check if the table "table1" exists in the Access database?. Thanks <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->
ADO RDD xHarbour
Elvira, ADOVERSION() Returns adordd version hb_adoRddGetConnection( nWorkArea ) Returns the connection for the workarea hb_adoRddGetRecordSet( nWorkArea ) Returns the recordset for the nWorkArea hb_adoRddGetTableName( nWorkArea ) Returns tabe name for the nWorkArea hb_adoRddExistsTable( oCon,cTable, cIndex ) Returns .t. if table or table and index exist on the DB hb_adoRddDrop( oCon, cTable, cIndex, DBEngine ) Drops (delete) table or index in the DB hb_GetAdoConnection() Returns ado default connection Exclusive its only working if you try to open the table in another instance of app. Updating records its still not verifying it if table its exclusive and since it does not find a lock record throws error. All this only working next post tomorrow.
ADO RDD xHarbour
Antonio, I can´t add, modify or delete records. I get that errors. I open the table like this: [code=fw:8lf6z6gz]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USE table1 <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"TEST2"</span> <span style="color: #00C800;">NEW</span> <br />&nbsp;</div>[/code:8lf6z6gz] And: [code=fw:8lf6z6gz]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USE table1 <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"TEST2"</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE<br />&nbsp;</div>[/code:8lf6z6gz] Both cases I get errors. Sorry, but the ADORDD is not ready yet. <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: --> <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
ADO RDD xHarbour
Elvira, Here tryadordd and variants are working perfectly. I can add modify and delete records with browse() or with append and replace . I dont work with xBrowse Did you tried with browse() Can you navigate well with xbrowse ? Can you send to my email your trial prg?
ADO RDD xHarbour
Antonio, Yes, I tested with Browse() and it fails. Here is my full sample: [code=fw:2xaft9xu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd.prg"</span><br /><br /><br /><br />REQUEST ADORDD, DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #00C800;">local</span> cPath := hb_dirbase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; RddRegister<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADORDD"</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />&nbsp; RddSetDefault<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADORDD"</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; SET ADODBF TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; SET ADO TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br /><br /><br />&nbsp; SET ADO <span style="color: #00C800;">DEFAULT</span> RECNO FIELD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ID"</span><br /><br />&nbsp; SET AUTOPEN <span style="color: #0000ff;">ON</span> <span style="color: #B900B9;">//might be OFF if you wish</span><br />&nbsp; SET AUTORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span> <span style="color: #B900B9;">// first index opened can be other</span><br /><br /><br />&nbsp; SET ADO <span style="color: #00C800;">DEFAULT</span> DATABASE <span style="color: #0000ff;">TO</span> CPATH+<span style="color: #ff0000;">"TEST2.mdb"</span> ENGINE <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ACCESS"</span> USER <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span> PASSWORD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span><br /><br />&nbsp; SET ADO LOCK CONTROL SHAREPATH <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"C:"</span> RDD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"DBFCDX"</span><br /><br /><br /><br /><span style="color: #B900B9;">//IF !FILE( "test2.mdb" )</span><br /><span style="color: #B900B9;">/*<br />DbCreate( "table1", { { "FIRST", "C", 30, 0 },;<br />{ "LAST", "C", 30, 0 },;<br />{ "AGE", "N", 8, 0 },;<br />{ "ID" ,"+",10, 0} }, "ADORDD" )<br />*/</span><br /><span style="color: #B900B9;">//ENDIF</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;USE table1 <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"TEST2"</span> <span style="color: #00C800;">NEW</span> <br />BROWSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; TEST2-><span style="color: #000000;">&#40;</span> &nbsp;OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TEST2"</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>ordsetfocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br />&nbsp; &nbsp;XBROWSER FASTEDIT<br /><br /><br />&nbsp; &nbsp;APPEND BLANK<br />&nbsp; &nbsp;test2->First &nbsp; := <span style="color: #ff0000;">"HOMER si no Homer"</span><br />&nbsp; &nbsp;test2->Last &nbsp; &nbsp;:= <span style="color: #ff0000;">"Simpson"</span><br />&nbsp; &nbsp;test2->Age &nbsp; &nbsp; := <span style="color: #000000;">45</span><br /><br />&nbsp; &nbsp;APPEND BLANK<br />&nbsp; &nbsp;test2->First &nbsp; := cValToChar<span style="color: #000000;">&#40;</span> nRandom<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" aaa Lara"</span><br />&nbsp; &nbsp;test2->Last &nbsp; &nbsp;:= <span style="color: #ff0000;">"Croft si no"</span><br />&nbsp; &nbsp;test2->Age &nbsp; &nbsp; := <span style="color: #000000;">32</span><br /><br /><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;DbCloseAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br />&nbsp;</div>[/code:2xaft9xu]
ADO RDD xHarbour
Antonio, Please confirm then meaning of each method aLockInfo[ UR_LI_METHOD ] DBLM_EXCLUSIVE DBLM_MULTIPLE DBLM_FILE
ADO RDD xHarbour
Antonio, Have you checked my sample?. Thank you.
ADO RDD xHarbour
Elvira, Yes and it runs ok here. I ve found out that the problem is with cursorlocation because with ACCESS aduseclient you can not :update() so I've change it to adUseServer but with adOpenKeyset because with adOpenDynamic ACCESS also does not work correctly. In my tests with MYSql everything its ok. Also since locks are enforced using Browse() you need to pass the deleteblock otherwise adorddd will raise "lock required" error as Browse() deletes without call dbrlock(). Exclusive use is still under development because it wasnt work correctly. Locks have been readjusted and now seem to work ok. When creating views please remember that you need to have also a autoinc field to be used as recno so you can include it in the "as select" statement. Please send me your email and Ill send you now last adordd. Did you managed to navigate correctly with xbrowse?
ADO RDD xHarbour
Mr Rao, Lucas, How can I use adUseServer cursor with MySql? I can only work with adUseClient.
ADO RDD xHarbour
New version adordd.prg posted <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Its very imortant that you indicate in adordd.prg in the several places with the cursorlocation the type of cursor you need to your DB. Not choosing the right cursor the browses become irregular. Please remember that all browse positioning is based on absoluteposition thus a cursor that can not support it doesnt work. Also you need a cursor that supports update() and requery(). The cursors defined in adordd support: ACCESS MYSQL ORACLE Changes: Locks now work as it should. Exclusive use in progress not validated Using Browse() you must pass delete block because it does not lock the record and adorddd raises a lock required error. Also when you change the index key value the browse() does not re-position immediately the grid. Click right or left arrows. adordd has been working ok with : ACCESS MYSQL ORACLE both in internal network and internet and its ok. Internet a little slow but not crawling with tables 30.000 recs. You must find which are the best parameters for your case and adjust it in ADO_OPEN Look for: [code=fw:1sp69mki]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; <span style="color: #B900B9;">//PROPERIES AFFECTING PERFORMANCE TRY</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//oRecordSet:MaxRecords := 60</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//oRecordSet:CacheSize := 50 //records increase performance set zero returns error set great server parameters max open rows error</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//oRecordset:PageSize = 10</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//oRecordSet:MaxRecords := 15</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//oRecordset:Properties("Maximum Open Rows") := 110 &nbsp;//MIN TWICE THE SIZE OF CACHESIZE</span><br />&nbsp;</div>[/code:1sp69mki] Please post your comments and findings.
ADO RDD xHarbour
Lucas, How can I set value for "Maximum Open Rows" with MySql? Is it possible with this property that the server only returns blocks of rows as they are requested? Can this increase performance? Thanks
ADO RDD xHarbour
Mr Rao, Lucas, We found a performance problem with adordd trials. The issue is that ADO_RECCOUNT (reccount() or lastrec()) sends a sql SELECT MAX(FIELD USED AS RECNO) This is delaying quite a bit all browses mainly on WAN because gets called many times. Taking this out the browses are quite fast. Is there a way to question the DB if table has been updated and only then adordd sends the sql SELECT? Or may be a faster way to question the DB ? Im trying it with MySql over LAN and WAN and the difference in browses performance its huge.
ADO RDD xHarbour
Antonio, I have not been able to test last version due lack of time. Does it work with Access now?. Which RDBMS have you tested?. Regarding configuration optimization settings, please review adofuncs.prg Fw_OpenAdoConnection and FW_OpenRecordSet. They are high optimized and work very well. Also, for a WAN connection, the key is to have a connection with low ping, such as cable or fiber. Good DSLs work fine too. About xBrowse speed, yes, it calls very often reccount(). Mr. Nages could provide more insight to it. Have you checked out XBROWSER FASTEDIT¿-
ADO RDD xHarbour
Antonio, congratulations for your work!!! I test to compile the adordd.prg with xHarbour and become many errors: [code=fw:26x2sgxj]<div class="fw" id="{CB}" style="font-family: monospace;">MAKE Version <span style="color: #000000;">5.2</span>  Copyright <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> <span style="color: #000000;">1987</span>, <span style="color: #000000;">2000</span> Borland<br />        c:\xharbour\bin\harbour.exe -i.;c:\fwh\include;c:\prg_allgemein;c:\<span style="color: #0000ff;">term</span><br />ne;c:\xharbour\include -n -m -w -es2 -gc3  -dtestfassung -d__GUN__ C:\adordd\ad<br />rdd.prg -o.\adordd.hrb<br />xHarbour <span style="color: #000000;">1.2</span><span style="color: #000000;">.3</span> Intl. <span style="color: #000000;">&#40;</span>SimpLex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>Build <span style="color: #000000;">20140725</span><span style="color: #000000;">&#41;</span><br />Copyright <span style="color: #000000;">1999</span><span style="color: #000000;">-2014</span>, http:<span style="color: #B900B9;">//www.xharbour.org <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m --></span><br />Compiling <span style="color: #ff0000;">'C:<span style="color: #000000;">\a</span>dordd<span style="color: #000000;">\a</span>dordd.prg'</span>...<br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">366</span><span style="color: #000000;">&#41;</span> Error E0022  Invalid lvalue: <span style="color: #ff0000;">':'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">524</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'T_CTABLENAME'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">627</span><span style="color: #000000;">&#41;</span> Warning W0002  Ambiguous reference, assuming memvar:<br /><span style="color: #000000;">AWDATA</span><span style="color: #ff0000;">'<br />C:<span style="color: #000000;">\a</span>dordd<span style="color: #000000;">\a</span>dordd.prg(628) Warning W0002  Ambiguous reference, assuming memvar:<br />AWDATA'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">922</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'NTOTSKIP'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1023</span><span style="color: #000000;">&#41;</span> Warning W0002  Ambiguous reference, assuming memvar:<br /><span style="color: #ff0000;">'AWADATA'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1122</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OERROR'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1123</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OERROR'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1124</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OERROR'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1125</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OERROR'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1126</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OERROR'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1127</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OERROR'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1128</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OERROR'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1129</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OERROR'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1643</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'NMAX'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1676</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1677</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1678</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1774</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1775</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1776</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1788</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1789</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1790</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1820</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1821</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">1822</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'N'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">3225</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'CKEYBOTOM'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">3929</span><span style="color: #000000;">&#41;</span> Warning W0002  Ambiguous reference, assuming memvar:<br /><span style="color: #ff0000;">'AWADATA'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">3958</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'OCN'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">3963</span><span style="color: #000000;">&#41;</span> Warning W0002  Ambiguous reference, assuming memvar:<br /><span style="color: #ff0000;">'AWADATA'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">4315</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'X'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">4316</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'X'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">4317</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'X'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">&#40;</span><span style="color: #000000;">4733</span><span style="color: #000000;">&#41;</span> Warning W0001  Ambiguous reference: <span style="color: #ff0000;">'CODLOCK'</span></div>[/code:26x2sgxj] Also the "hbusrrdd.ch" are not present at xHarbour (only usrrdd.ch) What to do?
ADO RDD xHarbour
[quote="lucasdebeltran":ju475lui]Antonio, I have not been able to test last version due lack of time. Does it work with Access now?. Which RDBMS have you tested?. Regarding configuration optimization settings, please review adofuncs.prg Fw_OpenAdoConnection and FW_OpenRecordSet. They are high optimized and work very well. Also, for a WAN connection, the key is to have a connection with low ping, such as cable or fiber. Good DSLs work fine too. About xBrowse speed, yes, it calls very often reccount(). Mr. Nages could provide more insight to it. Have you checked out XBROWSER FASTEDIT¿-[/quote:ju475lui] It works with ACCESS the problem was only with the chosen cursor. Now I'm only working with MYSql and its perfect. It works also with Oracle. Performance without ADORECCOUNT its excellent. Im trying to find a solution for it. Concerning Xbrowse I dont work with it but there is any reason not to work ok. Please let me know what is the problem with it ? In adordd its only missing: USE EXCLUSIVE APPEND FROM COPY TO
ADO RDD xHarbour
[quote="byte-one":9do002tf]Antonio, congratulations for your work!!! I test to compile the adordd.prg with xHarbour and become many errors: Also the "hbusrrdd.ch" are not present at xHarbour (only usrrdd.ch) What to do?[/quote:9do002tf] We are still clearing code. I'll post today a new version with these corrections and hbussrdd.ch. Thanks for your help.
ADO RDD xHarbour
Antonio, Latest version from 06 seems much better. I found a bug at dbcreate, you are not distinguishing Database and Table, so dbcreate fails. Also, command SET ADO TABLES INDEX LIST TO <array> and SET ADODBF TABLES INDEX LIST TO <array>have been changed?. I can´t see the difference. Also, SET ADO LOCK CONTROL SHAREPATH TO should take by default hb_dirbase(), so It won´t be called unless the programmer needs to change paths. In my opinion, the less settings the more easy for new programmers to test it. Thank you.
ADO RDD xHarbour
New version adordd.prg <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Please check readme.
ADO RDD xHarbour
[quote="lucasdebeltran":1683noph]Antonio, Latest version from 06 seems much better. I found a bug at dbcreate, you are not distinguishing Database and Table, so dbcreate fails. Also, command SET ADO TABLES INDEX LIST TO <array> and SET ADODBF TABLES INDEX LIST TO <array>have been changed?. I can´t see the difference. Also, SET ADO LOCK CONTROL SHAREPATH TO should take by default hb_dirbase(), so It won´t be called unless the programmer needs to change paths. In my opinion, the less settings the more easy for new programmers to test it. Thank you.[/quote:1683noph] Lucas, I just posted last version. I think Dbcreate working now. Please check it. SET ADO... and SET ADDBF didnt changed. SET ADO LOCK CONTROL SHAREPATH TO Ill change it next post Does it work ok with xbrowse? Im only working now with MySql.
ADO RDD xHarbour
Lucas, adordd works mainly with cursor adUseClient. This brings a problem because new and deleted records by others are not seen. Deleted records its not so difficult because in editions or transactions when we lock we do resync and if there is an error we requey and locks fail so edition or transaction doesn't not proceed. But with new records... We are studying a way to trigger that and requery again the recordset when needed. As ADO expertise do you have any solution or idea for this? Thanks for your precious help.