topic
stringlengths
1
63
text
stringlengths
1
577k
ADO RDD xHarbour
Lucas, This is a access limitation. I get the same error. Record too big With MySql perfect!
ADO RDD xHarbour
Antonio, Could you provide a URL for the most recent ADORDD version ? thanks
ADO RDD xHarbour
Antonio, You have to wait that Antonio finishes some bugs, as current version is still not usable.
ADO RDD xHarbour
Lucas, adordd emailed. Antonio, We are still finishing some parts I expect to publish it again tomorrow evening. Meantime I need to alter FILE() to check if the table or index exists in the DB. How can we do it?
ADO RDD xHarbour
Antonio, You can't modify File() behavior as far as I know as it is a standard Harbour function. You can use FWH function FW_AdoTableExists( cAdoTable, oConnection )
ADO RDD xHarbour
Antonio, Ok but I think it would make sense.
ADO RDD xHarbour
Antonio, I sent an email with bugs and fixes proposed. About FILE, for checking dbfs I have a function like this: [code=fw:3r880fnu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">FUNCTION</span> IsDataBase<span style="color: #000000;">&#40;</span> cFichero &nbsp;<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> lResult := .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> RddSetDefault<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"SQLRDD"</span><br /><br />&nbsp; &nbsp; &nbsp; cFichero := cFileNoExt<span style="color: #000000;">&#40;</span> cFichero <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; lResult &nbsp;:= SR_File<span style="color: #000000;">&#40;</span> cFichero <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; lResult := File<span style="color: #000000;">&#40;</span> cFichero <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> RddSetDefault<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"ADORDD"</span><br /><span style="color: #B900B9;">//msginfo( cfichero, "pending")</span><br />lResult := .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> lResult <span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp;</div>[/code:3r880fnu]
ADO RDD xHarbour
Antonio, About dbcreate autoincrement field, we sould use Ains instead of Aad: [code=fw:o1oynop1]<div class="fw" id="{CB}" style="font-family: monospace;">AIns<span style="color: #000000;">&#40;</span> aCols, <span style="color: #000000;">1</span>, <span style="color: #000000;">&#123;</span> &nbsp;ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, .t. <span style="color: #000000;">&#41;</span></div>[/code:o1oynop1] Thanks.
ADO RDD xHarbour
Hello! For me only the MS SQL Server is important. This text from MSDN should be respected: [quote:2xzdha91]Note If you are connecting to a data source provider that supports Windows authentication, you should specify Trusted_Connection=yes or Integrated Security = SSPI instead of user ID and password information in the connection string. [/quote:2xzdha91] Error: In TRYADORDD.prg (dbcreate(...)) the database for this engine are not created!!
ADO RDD xHarbour
Gunther, The dbcreate() should work with mssql but unfortunately I can only try it with MySql. Is it because of the connection string without user and password ? Can you try it yourself altering the connection parameters in ADOCONNECT()?
ADO RDD xHarbour
[quote="lucasdebeltran":cpyzkqid]Antonio, About dbcreate autoincrement field, we sould use Ains instead of Aad: [code=fw:cpyzkqid]<div class="fw" id="{CB}" style="font-family: monospace;">AIns<span style="color: #000000;">&#40;</span> aCols, <span style="color: #000000;">1</span>, <span style="color: #000000;">&#123;</span>  ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, .t. <span style="color: #000000;">&#41;</span></div>[/code:cpyzkqid] Thanks.[/quote:cpyzkqid] Lucas, Check my email. I choose to add it in ado_open(). In Mysql its possible to add columns with open table but in access I doubt. I choose this way because you can then upload your actual tables with copy to and then when you open it automatically be converted with autoinc field defined in set ado default recno. What is your opinion?
ADO RDD xHarbour
Antonio, Sorry, I don´t understand. We have to check it at FUNCTION ADOSTRUCTTOSQL(). If the programmer has indicated in aStruct the autoincremental field, it´s perfect, nothing to be done. Otherwhise: [code=fw:1qx855sh]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> aAcan<span style="color: #000000;">&#40;</span> aStruct, ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span><br />  AIns<span style="color: #000000;">&#40;</span> aCols, <span style="color: #000000;">1</span>, <span style="color: #000000;">&#123;</span>  ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, .t. <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br /> </div>[/code:1qx855sh] That´s it.
ADO RDD xHarbour
Lucas, This is in ado_open() for next fields [code=fw:3ov2x4bt]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> ADO_FIELDSTRUCT<span style="color: #000000;">&#40;</span> oRecordSet, n<span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"+"</span> <span style="color: #B900B9;">//OUR FIELD RECNO CAN ONLY BE ONE PER TABLE ITS ALREADY DEFINED USE IT</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span>:= &nbsp;n - <span style="color: #000000;">1</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//IF IT SUPPORTS SEEK WE WILL SEEK IT ISNTEAD OF FIND IT</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> !oRecordSet:<span style="color: #000000;">Supports</span><span style="color: #000000;">&#40;</span>adIndex<span style="color: #000000;">&#41;</span> .OR. !oRecordSet:<span style="color: #000000;">Supports</span><span style="color: #000000;">&#40;</span>adSeek<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//OTHERWISE LETS USE ADO INDEX PROP TO SPEED UP</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> &nbsp;oRecordSet:<span style="color: #000000;">CursorLocation</span> = adUseClient&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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: #000000;">&#41;</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Optimize"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">1</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;">ENDIF</span>&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp;</div>[/code:3ov2x4bt] Outside the next: [code=fw:3ov2x4bt]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><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> <span style="color: #B900B9;">//DONT HAVE ANY AUTO INC FIELD USE AS RECNO CREATE</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> ! EMPTY<span style="color: #000000;">&#40;</span>ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span> &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cName := <span style="color: #ff0000;">"ALTER TABLE "</span>+ aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">" ADD "</span>+ ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span> &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cName += HB_DECODE<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span>, &nbsp;<span style="color: #ff0000;">"DBASE"</span>, <span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">"ACCESS"</span>,<span style="color: #ff0000;">" AUTOINCREMENT"</span>,<span style="color: #ff0000;">"MSSQL"</span>,<span style="color: #ff0000;">" INT IDENTITY( 1, 1 )"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"MYSQL"</span>, <span style="color: #ff0000;">" INT AUTO_INCREMENT"</span>,<span style="color: #ff0000;">"ORACLE"</span>,<span style="color: #ff0000;">" INT"</span>,<span style="color: #ff0000;">"SQLITE"</span>,<span style="color: #ff0000;">" INTEGER"</span>,<span style="color: #ff0000;">"FOXPRO"</span>,<span style="color: #ff0000;">" NUMERIC"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"POSTGRE"</span>,<span style="color: #ff0000;">" SERIAL"</span>,<span style="color: #ff0000;">"INFORMIX"</span>,<span style="color: #ff0000;">" SERIAL"</span>,<span style="color: #ff0000;">"ANYWHERE"</span>,<span style="color: #ff0000;">" INTEGER IDENTITY"</span>,<span style="color: #ff0000;">"ADS"</span>,<span style="color: #ff0000;">" AUTOINC"</span>, <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> <> <span style="color: #ff0000;">"ADS"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cName &nbsp;+= <span style="color: #ff0000;">", ADD PRIMARY KEY "</span>+ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span> &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <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; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">execute</span><span style="color: #000000;">&#40;</span>cName<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_NAME <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;:= ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span> &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;:= HB_FT_AUTOINC<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_TYPEEXT <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_LEN <span style="color: #000000;">&#93;</span> &nbsp; &nbsp; := <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_DEC <span style="color: #000000;">&#93;</span> &nbsp; &nbsp; := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UR_SUPER_ADDFIELD<span style="color: #000000;">&#40;</span> nWA, aField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span> := ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span> &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> !oRecordSet:<span style="color: #000000;">Supports</span><span style="color: #000000;">&#40;</span>adIndex<span style="color: #000000;">&#41;</span> .OR. !oRecordSet:<span style="color: #000000;">Supports</span><span style="color: #000000;">&#40;</span>adSeek<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//OTHERWISE LETS USE ADO INDEX PROP TO SPEED UP</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> &nbsp;oRecordSet:<span style="color: #000000;">CursorLocation</span> = adUseClient&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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: #000000;">&#41;</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Optimize"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">1</span> <br />&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;">ENDIF</span>&nbsp; &nbsp;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CATCH<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span> := <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// ADOSHOWERROR(aWAData[ WA_CONNECTION ])</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp;</div>[/code:3ov2x4bt]
ADO RDD xHarbour
adordd its working quite well but still some adjustments to do. (MySql) Our client is working with the app with adordd in MySql in parallel with the same app with ADS comparing all transactions and behavior between the two. He s quit happy. (2nd week trials on real data) The app its more than 90% converted ( tested ) and we only needed to change till now a couple of index create expressions and like this: [code=fw:3qr7vwkw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> RDDNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"ADORDD"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cexpress := <span style="color: #ff0000;">"CONVERT(ano,UNSIGNED)*100+CONVERT(sementrega,UNSIGNED) >="</span> +semanaini+<span style="color: #ff0000;">" and "</span>+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"CONVERT(ano,UNSIGNED)*100+CONVERT(sementrega,UNSIGNED) <= "</span>+semanafim+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" and nrfactur = ' &nbsp; &nbsp; &nbsp; &nbsp; '"</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;cexpress := <span style="color: #ff0000;">"val(ano)*100+val(sementrega) >=val('"</span>+str<span style="color: #000000;">&#40;</span>semanaini<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"') .and."</span>+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"val(ano)*100+val(sementrega) <= val('"</span>+str<span style="color: #000000;">&#40;</span>semanafim<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"')"</span>+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">".and. nrfactur == space(10)"</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp;</div>[/code:3qr7vwkw] The only true complaint till now is the speed problem with dbeval() mainly in SUM operations. Its really very slow and we cant find out why! Antonio any ideas? Meanwhile we found that in certain SELECT.. WHERE... field properties become inaccessible even when recordset its not empty. Add records its not possible. Fortunately we only need it for autoinc property and we found a workaround. Maybe Mr.Rao knows the reason for it. Our client has its own filter routines either already through SELECTS or by filing arrays so its not important to us nevertheless because will certainly be important for the market in general Im checking with Lucas a workaround to make it 100% compatible with (x)Harbour syntax. Any contribution is most welcome! Now it seems that we have more 2 clients interested in porting apps to SQL. (one MySql other Oracle) <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Please note that adordd its only being tested with ADS oledb, ACCESS and MySql. I expect to post a new version today's evening or tomorrow morning. Letting (x)Harbour to navigate freely around all data. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
ADO RDD xHarbour
Antonio, I am also having trouble with MySQL. For somehow, at ADOFINDREC() oRecordSet:AbsolutePosition := IF( oRS:AbsolutePosition == adPosEOF, oRS:RecordCount() + 1, oRS:AbsolutePosition ) is set to -1, and it gives an error. oRecordSet:AbsolutePosition can´t be minor than 0. Do yoy know why? Thank you.
ADO RDD xHarbour
Lucas, You don't have recno field and your cursor doesn't support bookmarks. Please note that although the code foresee a situation where you don't have hbrenco results would be unpredictable in some circumstances. If you are using version sent by last email when you opened this table it should have created the hbrecno field . Please check.
ADO RDD xHarbour
Antonio, Yes, I do have HBRECNO and I am using your code. In fact, at ADO_OPEN( nWA, aOpenInfo ), you added : IF EMPTY(aWAData[WA_FIELDRECNO]) //DONT HAVE ANY AUTO INC FIELD USE AS RECNO CREATE .... Well, despite I have HBRECNO, aWAData[WA_FIELDRECNO is giving 0. Also, the sintax for ALTER TABLE is failing too.
ADO RDD xHarbour
Lucas, If it is the first field can be 0! Might be a bug. In all our tables its always the last field and I suspect that with zero IF EMPTY(aWAData[WA_FIELDRECNO]) rerturns .t.. Please try delete hbrecno and add it to the end of all fields.
ADO RDD xHarbour
Antonio, Another bug in ADO_APPEND() and MySQL. Dates are not saved into aVals, so oRs:AddNew( aCols, aVals ) fails. Also maybe a problem with empty dates?.
ADO RDD xHarbour
Antonio, [quote:32iiviic]Please try delete hbrecno and add it to the end of all fields.[/quote:32iiviic] Yes, in that case works, but I think HBRECNO should be the first field, also as the PRIMARY KEY. Thank you.
ADO RDD xHarbour
Lucas, [quote:ci9r75zo] Another bug in ADO_APPEND() and MySQL. Dates are not saved into aVals, so oRs:AddNew( aCols, aVals ) fails. Also maybe a problem with empty dates?. [/quote:ci9r75zo] Here working ok. [code=fw:ci9r75zo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />append blank<br />replace datefield with date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:ci9r75zo] Can you post a example?
ADO RDD xHarbour
Antonio, It´s with MySQL. At ADO_APPEND, i checked aVals and date fields very empty. Are you testing with Access or MySQL?. With ACCESS Works fine.
ADO RDD xHarbour
Lucas, MySql and its working ok.
ADO RDD xHarbour
[quote="lucasdebeltran":15942jlr]Antonio, It´s with MySQL. At ADO_APPEND, i checked aVals and date fields very empty. Are you testing with Access or MySQL?. With ACCESS Works fine.[/quote:15942jlr] This might be due to not nullable fields defined in MySql table structure.
ADO RDD xHarbour
Lucas, Basic :filter ready. Please note that expressions like '.. month(fielddate) =' are invalid. We cant use functions in field expressions. The only way to use standard filter expressions is like in the mail Ive sent you. I don't see any other way. Concerning add column in first position to use as recno please note that as far as I discover that is only possible in MySql and Oracle other RMBDs do not allow it. Testing EMPTY( ..[ WA_FIELDRECNO] ) changed to !VALTYPE( ..[ WA_FIELDRECNO] ) == "U" because if field in first column value would be zero and empty true.
ADO RDD xHarbour
Antonio, No, the replace is as follows: REPLACE FIELD->FECHA WITH Date(). Here is MySQL capture: [img:2vbpi6sl]http&#58;//i60&#46;tinypic&#46;com/ehej9z&#46;png[/img:2vbpi6sl] About filtering, I don´t understand. ADORDD should be able to support filters like those ones: [code=fw:2vbpi6sl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; cCondicion := <span style="color: #ff0000;">"Dtoc( FIELD->FECHA ) >= "</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span> + Dtoc<span style="color: #000000;">&#40;</span> dFecha1 <span style="color: #000000;">&#41;</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" .AND. Dtoc( FIELD->FECHA ) <= "</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span> + Dtoc<span style="color: #000000;">&#40;</span> dFecha2 <span style="color: #000000;">&#41;</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp; SET FILTER <span style="color: #0000ff;">TO</span> alltrim<span style="color: #000000;">&#40;</span> &nbsp;AUXILIAR->RELACION &nbsp;<span style="color: #000000;">&#41;</span> == alltrim<span style="color: #000000;">&#40;</span> &nbsp;STR<span style="color: #000000;">&#40;</span> oData:<span style="color: #000000;">Codigo</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; cCondicion := <span style="color: #ff0000;">"CONTA->CONCEPTO = "</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span> + alltrim<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> cCuentaoConcepto <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:2vbpi6sl] Maybe Antonio, Nages, Enrico or Rick can help us to achieve it. Thank you. I think it´s possible to translate them to ADO oRs:Filter().
ADO RDD xHarbour
Lucas, Mailed you last version. [quote:171npgya]cCondicion := "Dtoc( FIELD->FECHA ) >= " + chr( 34 ) + Dtoc( dFecha1 ) + chr( 34 ) + ; " .AND. Dtoc( FIELD->FECHA ) <= " + chr( 34 ) + Dtoc( dFecha2 ) + chr( 34 ) SET FILTER TO alltrim( AUXILIAR->RELACION ) == alltrim( STR( oData:Codigo )) cCondicion := "CONTA->CONCEPTO = " + chr( 34 ) + alltrim( cValToChar( cCuentaoConcepto ) ) + chr( 34 )[/quote:171npgya] These should be ok since the are simply cleaned from expression because they are only conversion functions. But when we use "extraction" functions like month etc I cant see how it can works because they are out of scope in :filter.
ADO RDD xHarbour
Lucas, [quote:1m7w63eb]No, the replace is as follows: REPLACE FIELD->FECHA WITH Date(). [/quote:1m7w63eb] Here with MySql it works so must be a configuration issue. Here fielddate is: FIELDDATE DATE NULL DEFAULT NULL; All other options empty
ADO RDD xHarbour
Lucas, Your MySql innoDB ?
ADO RDD xHarbour
Antonio, With the version you just send me, there are some bugs so far: At, ADOFINDREC(), oRecordSet:AbsolutePosition := IF( oRS:AbsolutePosition == adPosEOF, oRS:RecordCount() + 1, oRS:AbsolutePosition ) is failing, as IF( oRS:AbsolutePosition == adPosEOF, oRS:RecordCount() + 1, oRS:AbsolutePosition ) its giving -1, which is not possible. HBRECNO is not created by default. Also, the code at ADO_OPEN is not being proccessed to add it. I suggested to simple add it to ADOCREATE(), which is the easiest way as explained before. Also, to help debugging, please at AdoShowError, add procname(2) to 7: [code=fw:2jzev7nj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> ADOSHOWERROR<span style="color: #000000;">&#40;</span> oCn, lSilent <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> nErr, oErr, cErr<br /><br />   <span style="color: #00C800;">DEFAULT</span> oCn <span style="color: #0000ff;">TO</span> oConnection<br />   <span style="color: #00C800;">DEFAULT</span> lSilent <span style="color: #0000ff;">TO</span> .F.<br /><br />   <span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span> nErr := oCn:<span style="color: #000000;">Errors</span>:<span style="color: #0000ff;">Count</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />      oErr  := oCn:<span style="color: #000000;">Errors</span><span style="color: #000000;">&#40;</span> nErr - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">IF</span> ! lSilent<br />         WITH OBJECT oErr<br />            cErr     := oErr:<span style="color: #000000;">Description</span><br />            cErr     += CRLF + <span style="color: #ff0000;">'Source       : '</span> + oErr:<span style="color: #000000;">Source</span><br />            cErr     += CRLF + <span style="color: #ff0000;">'NativeError  : '</span> + cValToChar<span style="color: #000000;">&#40;</span> oErr:<span style="color: #000000;">NativeError</span> <span style="color: #000000;">&#41;</span><br />            cErr     += CRLF + <span style="color: #ff0000;">'Error Source : '</span> + oErr:<span style="color: #000000;">Source</span><br />            cErr     += CRLF + <span style="color: #ff0000;">'Sql State    : '</span> + oErr:<span style="color: #000000;">SQLState</span><br />            cErr     += CRLF + REPLICATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'-'</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">&#41;</span><br />            cErr     += CRLF + PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"( "</span> + cValToChar<span style="color: #000000;">&#40;</span> PROCLINE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" )"</span><br />            cErr     += CRLF + PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"( "</span> + cValToChar<span style="color: #000000;">&#40;</span> PROCLINE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" )"</span><br />            cErr     += CRLF + PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"( "</span> + cValToChar<span style="color: #000000;">&#40;</span> PROCLINE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" )"</span><br />            cErr     += CRLF + PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"( "</span> + cValToChar<span style="color: #000000;">&#40;</span> PROCLINE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" )"</span><br />            cErr     += CRLF + PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"( "</span> + cValToChar<span style="color: #000000;">&#40;</span> PROCLINE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" )"</span><br />            cErr     += CRLF + PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"( "</span> + cValToChar<span style="color: #000000;">&#40;</span> PROCLINE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" )"</span><br />            cErr     += CRLF + PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"( "</span> + cValToChar<span style="color: #000000;">&#40;</span> PROCLINE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" )"</span></div>[/code:2jzev7nj]
ADO RDD xHarbour
Fix for HBRECNO creating: [code=fw:1kew1pv8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_CREATE<span style="color: #000000;">&#40;</span> nWA, aOpenInfo &nbsp;<span style="color: #000000;">&#41;</span><br /><br />&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; <span style="color: #00C800;">LOCAL</span> cTable &nbsp;:= hb_tokenGet<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">LOCAL</span> cDataBase &nbsp;:= hb_tokenGet<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">LOCAL</span> cDbEngine &nbsp;:= hb_tokenGet<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">3</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">LOCAL</span> cServer &nbsp; &nbsp;:= hb_tokenGet<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">4</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">LOCAL</span> cUserName &nbsp;:= hb_tokenGet<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">5</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">LOCAL</span> cPassword &nbsp;:= hb_tokenGet<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">6</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">LOCAL</span> cSql, cSql2, lAddAutoInc := .F.<br />&nbsp; <span style="color: #00C800;">LOCAL</span> oCatalog , cMarkTmp, lNoError := .T.,cTmpTable<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span>cDbEngine<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//IF NOT DEFINED USE DEFAULT</span><br />&nbsp; &nbsp; &nbsp; ADODEFAULTS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> cDataBase <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">""</span> ,cDataBase:= t_cDataSource, cDataBase <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">""</span> , cTable := aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> ,cTable<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> cDbEngine <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">""</span> ,cDbEngine:= t_cEngine, cDbEngine <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> cServer <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">""</span> , cServer:= t_cServer, cServer <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> cUserName <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">""</span> , cUserName:= t_cUserName, cUserName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> cPassword <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">""</span> , cPassword:= t_cPassword, cPassword <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; hb_adoSetDSource<span style="color: #000000;">&#40;</span>cDataBase<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; hb_adoSetEngine<span style="color: #000000;">&#40;</span> cDbEngine <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; hb_adoSetServer<span style="color: #000000;">&#40;</span> cServer <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; hb_adoSetUser<span style="color: #000000;">&#40;</span> cUserName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; hb_adoSetPassword<span style="color: #000000;">&#40;</span> cPassword <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> cDbEngine = <span style="color: #ff0000;">"ACCESS"</span> <span style="color: #B900B9;">//t_cEngine WITH DEFAULT VALUE BU ADODEFAULTS</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> !FILE<span style="color: #000000;">&#40;</span>cDataBase<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCatalog &nbsp; &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;">"ADOX.Catalog"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCatalog:<span style="color: #000000;">Create</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="</span> + cDataBase <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> := CFILENOEXT<span style="color: #000000;">&#40;</span> CFILENOPATH<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;ADOCONNECT<span style="color: #000000;">&#40;</span> nWA, aOpenInfo <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp;fix to add HBRECNO if it´s not present &nbsp;// Lucas De Beltran 23.05.2015<br />&nbsp; &nbsp;*/</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> AScan<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_SQLSTRUCT <span style="color: #000000;">&#93;</span>, ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; AIns<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_SQLSTRUCT <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">&#123;</span> &nbsp;ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><br />&nbsp; &nbsp;cSql := ADOSTRUCTTOSQL<span style="color: #000000;">&#40;</span> aWAData, aWAData<span style="color: #000000;">&#91;</span> WA_SQLSTRUCT <span style="color: #000000;">&#93;</span>,@lAddAutoInc <span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:1kew1pv8]
ADO RDD xHarbour
Lucas, [quote:2tu34i3j] Antonio, With the version you just send me, there are some bugs so far: At, ADOFINDREC(), oRecordSet:AbsolutePosition := IF( oRS:AbsolutePosition == adPosEOF, oRS:RecordCount() + 1, oRS:AbsolutePosition ) is failing, as IF( oRS:AbsolutePosition == adPosEOF, oRS:RecordCount() + 1, oRS:AbsolutePosition ) its giving -1, which is not possible. HBRECNO is not created by default. Also, the code at ADO_OPEN is not being proccessed to add it. I suggested to simple add it to ADOCREATE(), which is the easiest way as explained before. Also, to help debugging, please at AdoShowError, add procname(2) to 7: [/quote:2tu34i3j] HBRECNO or equivalent is missing. Im going to take out that code and it simply errors stating missing field... AbsolutePosition Positionenum [quote:2tu34i3j] Constant Value Description adPosBOF -2 Indicates that the current record pointer is at BOF (that is, the BOF property is True). adPosEOF -3 Indicates that the current record pointer is at EOF (that is, the EOF property is True). adPosUnknown -1 Indicates that the Recordset is empty, the current position is unknown, or the provider does not support the AbsolutePage or AbsolutePosition property. [/quote:2tu34i3j] Please also check your MySql ODBC driver params. ADD COLUMN I need to have it in ADO_OPEN. Our client upload the tables with copy to and tehn he expects when opening it to have the field created. Ill put it also in ADO_CREATE
ADO RDD xHarbour
Antonio, With my previous code for HBRECNO, ADOFINDREC() does not fail. Thank you.
ADO RDD xHarbour
Antonio, DbAppend(, ADO_APPEND(), fails with dates here: [code=fw:1gnop0pg]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AADD<span style="color: #000000;">&#40;</span> aVals, HB_DECODE<span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">'C'</span>, Space<span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'D'</span>, CToD<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'L'</span>, .f., ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'M'</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">'m'</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">0</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'N'</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, Val<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"0."</span> + Replicate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'0'</span>, aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'T'</span>, CTOT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1gnop0pg] It does not support an empty CTDOD().
ADO RDD xHarbour
Antonio, I asked about empty dates at append blank. Also, SET FILTER does not suport values, i.e: [code=fw:1btupuaa]<div class="fw" id="{CB}" style="font-family: monospace;"><br />SET FILTER <span style="color: #0000ff;">TO</span> LUCAS->NAME == cName<br /> </div>[/code:1btupuaa] Thank you. Seems less to finish ADORDD.
ADO RDD xHarbour
Lucas, [quote:1kvyet68]It does not support an empty CTDOD().[/quote:1kvyet68] How can it work here like that? adordd its prepared to consider 31/12/1899 as empty date. We place 31/12/1899? [quote:1kvyet68]With my previous code for HBRECNO, ADOFINDREC() does not fail.[/quote:1kvyet68] Table is the same ? Here that version its working. There must be something wrong with your config. Here all its working. ADO_OPEN it inserts field set to be used as recno as first field primary key. Do you have SET ADO DEFAULT RECNO FIELD TO .. defined?
ADO RDD xHarbour
Lucas, [quote:21606f89]I asked about empty dates at append blank.[/quote:21606f89] Please explain. [quote:21606f89]Also, SET FILTER does not suport values, i.e: Code: SET FILTER TO LUCAS->NAME == cName [/quote:21606f89] Thats what I was speaking about. All vars must be evaluated before sent to ado filter once they are out of scope there. In order to be 100 % compatible with standard syntax we must evaluate the filter condition ourselves and build a "faik" recordset. Again please check your config because here all your mentioned points are working.
ADO RDD xHarbour
Antonio, About filtering, is not possible at SqlTranslate() to evalutate cName, so as to get its value and build the filter?.
ADO RDD xHarbour
Antonio, At ADOAPPEND(), and using Mr. Nages advice, this is the proper fix: [code=fw:2s4fo7x1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span> aVals, HB_DECODE<span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">'C'</span>, Space<span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'D'</span>, AdoNull<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'L'</span>, .f., ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'M'</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">'m'</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">0</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'N'</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, Val<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"0."</span> + Replicate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'0'</span>, aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'T'</span>, AdoNull<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp;</div>[/code:2s4fo7x1]
ADO RDD xHarbour
Antonio, I get this error: [quote:3qluylq5] [0x80040E38][Microsoft Cursor Engine] Row cannot be located for updating. Some values may have been changed since it was last read Error description: (DOS Error -2147352567) WINOLE/1007 No se puede encontrar la fila para su actualización: algunos valores han cambiado desde la última vez que se leyó. (0x80040E38): Microsoft Cursor Engine Stack Calls =========== Called from: => TOLEAUTO:UPDATE( 0 ) Called from: source\adordd.prg => ADO_PUTVALUE( 1503 ) [/quote:3qluylq5] ADO_PUTVALUE( 1503 ) -> oRecordSet:Update() oRecordSet:Fields( nField - 1 ):Value := xValue oRecordSet:Update() This is my code: REPLACE FACTURAS->NOMBRE WITH CLIENTES->NOMBRE .... and so one The real cause: Field lengh for FACTURAS nombre is 34, but in CLIENTES is 50.
ADO RDD xHarbour
But current NAME is LUCAS DE BELTRAN, not 50 or 34 chars.
ADO RDD xHarbour
Lucas, [quote:65yab36l] DO_PUTVALUE( 1503 ) -> oRecordSet:Update() oRecordSet:Fields( nField - 1 ):Value := xValue oRecordSet:Update() This is my code: REPLACE FACTURAS->NOMBRE WITH CLIENTES->NOMBRE .... and so one The real cause: Field lengh for FACTURAS nombre is 34, but in CLIENTES is 50. [/quote:65yab36l] This works here. adordd automatically truncates : C values to the len of the field N values decimals round to the number of decimals in the field left part of the number it throws a error data_with. Did you try this after copy to to build this table? Your addition on ado_append to insert field recno cant be used because with "copy to" all fields will be out of order between the source table and destination table We must use aadd() field. Field dates in "copy to" when the source table was opened via ex"dbfcdx" continues to error. Filters we will need some help because I dont have now the time to worry to much about it as I dont need it for this project. Ill try to do the best I can.
ADO RDD xHarbour
Antonio, I don´t understand what you say about dates. Your xHarbour version has a bug, but recent Harbour and xHarbour must have an emtpy date, and it´s achieved by using AdoNull(). This code at ADO_APPEND() works fine and have been tested: [code=fw:22kr5qr0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AADD<span style="color: #000000;">&#40;</span> aVals, HB_DECODE<span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">'C'</span>, Space<span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'D'</span>, AdoNull<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'L'</span>, .f., ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'M'</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">'m'</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">0</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'N'</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, Val<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"0."</span> + Replicate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'0'</span>, aStruct<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'T'</span>, AdoNull<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp;</div>[/code:22kr5qr0] No, I have not use COPY TO or APPEND TO. I see your point about the fix for HBRECNO. But your code at ADO_OPEN did´t work: the SQL sinxtax at ALTER TABLE and the condition to execute both fail. FW provides SQL ALTER TABLE <tbl> <cop:ADD,MODIFY,ALTER> [COLUMN] <acol> => FW_AdoAddModiColSQL( <(tbl)>, <acol>, <"cop"> ) I asked Harbour and xHarbour developers help about Filters. ADORDD is close to be ready. Thank you.
ADO RDD xHarbour
Lucas, Filters without any change in the app code. (I dont know about performance) [code=fw:19h85cvh]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_SETFILTER<span style="color: #000000;">&#40;</span> nWA, aFilterInfo <span style="color: #000000;">&#41;</span><br /><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> oError, nRecNo, aBookMarks := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>,nDecimals := SET<span style="color: #000000;">&#40;</span> _SET_DECIMALS<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> VALTYPE<span style="color: #000000;">&#40;</span>aFilterInfo<span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"A"</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span>WA_FILTERACTIVE<span style="color: #000000;">&#93;</span> := aFilterInfo<span style="color: #000000;">&#91;</span> UR_FRI_BEXPR <span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">//SAVE ACTIVE FILTER EXPRESION</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">ELSE</span> <span style="color: #B900B9;">//CHECKING ACTVE FILTER IF ONE</span><br />&nbsp; &nbsp; &nbsp; <br />&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_FILTERACTIVE<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_SUCCESS &nbsp;<span style="color: #B900B9;">//NONE CONTINUE WITH CURRENT TASK</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; ADO_RECID<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;">IF</span> oRecordSet:<span style="color: #000000;">Supports</span><span style="color: #000000;">&#40;</span>adBookmark<span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp;SET<span style="color: #000000;">&#40;</span> _SET_DECIMALS, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//IF BOOKMARK NUMERIC IT COMES WITH DEFINED DECIMALS MUST SET IT TO 0</span><br />&nbsp; &nbsp; &nbsp; <br />&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; <br />&nbsp; &nbsp; &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; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> EVAL<span style="color: #000000;">&#40;</span> aFilterInfo<span style="color: #000000;">&#91;</span> UR_FRI_BEXPR <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AADD<span style="color: #000000;">&#40;</span> aBookMarks, oRecordSet:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &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; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br />&nbsp; &nbsp; &nbsp; &nbsp;SET<span style="color: #000000;">&#40;</span> _SET_DECIMALS, nDecimals <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">Filter</span> := aBookMarks &nbsp; <span style="color: #B900B9;">//ARRAY OF BOOKMARKS</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Filter</span> := SqlTranslate<span style="color: #000000;">&#40;</span>aFilterInfo<span style="color: #000000;">&#91;</span> UR_FRI_CEXPR <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;CATCH <span style="color: #B900B9;">//SHOULD RAISE AN ERROR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> VALTYPE<span style="color: #000000;">&#40;</span>aFilterInfo<span style="color: #000000;">&#91;</span> UR_FRI_CEXPR <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Expression not allowed! "</span> +SqlTranslate<span style="color: #000000;">&#40;</span>aFilterInfo<span style="color: #000000;">&#91;</span> UR_FRI_CEXPR <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span> <br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;END<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span> &nbsp; <br /><br />&nbsp; &nbsp; ADO_GOTOID<span style="color: #000000;">&#40;</span> nWA, nRecNo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> oRecordSet:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//does not have this rec in filter lets gotop</span><br />&nbsp; &nbsp; &nbsp; &nbsp;ADO_GOTOP<span style="color: #000000;">&#40;</span>nWa<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br /><br /><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_CLEARFILTER<span style="color: #000000;">&#40;</span> nWA <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 := 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> aOrderInfo := ARRAY<span style="color: #000000;">&#40;</span>UR_ORI_SIZE<span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span>WA_FILTERACTIVE<span style="color: #000000;">&#93;</span> := <span style="color: #00C800;">NIL</span> <span style="color: #B900B9;">//NO FILTER</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</span>oRecordSet:<span style="color: #000000;">Filter</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp;</div>[/code:19h85cvh] Please try it and let me know results.
ADO RDD xHarbour
Antonio, Thank you. ADO_CLEARFILTER() should be as follows: [code=fw:334ypifg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_CLEARFILTER<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> aWAData    := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />   <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 />   <span style="color: #00C800;">LOCAL</span> aOrderInfo := ARRAY<span style="color: #000000;">&#40;</span>UR_ORI_SIZE<span style="color: #000000;">&#41;</span><br /><br />   aWAData<span style="color: #000000;">&#91;</span>WA_FILTERACTIVE<span style="color: #000000;">&#93;</span> := <span style="color: #00C800;">NIL</span> <span style="color: #B900B9;">//NO FILTER</span><br /><br />   <span style="color: #B900B9;">// fix Lucas de Beltrán 24.05.2015</span><br />   <span style="color: #00C800;">IF</span> ValType<span style="color: #000000;">&#40;</span> oRecordSet <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"O"</span><br /><br />      <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</span>oRecordSet:<span style="color: #000000;">Filter</span> <span style="color: #000000;">&#41;</span><br />         oRecordSet:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">""</span><br />      <span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #00C800;">ENDIF</span><br /><br /><br />   <span style="color: #00C800;">RETURN</span> HB_SUCCESS<br /><br /> </div>[/code:334ypifg] Also, I am getting Error description: (DOS Error -2147352567) WINOLE/1007 Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. (0x800A0BCD): ADODB.Recordset at ADO_SETFILTER(), ado_gotop(), at the very end: [code=fw:334ypifg]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp;<span style="color: #00C800;">IF</span> oRecordSet:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//does not have this rec in filter lets gotop</span><br />&nbsp; &nbsp; &nbsp; &nbsp;ADO_GOTOP<span style="color: #000000;">&#40;</span>nWa<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp;</div>[/code:334ypifg] Also, a fix for empty tables at ADO_SETFILTER(): [code=fw:334ypifg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> oRecordSet:<span style="color: #000000;">Supports</span><span style="color: #000000;">&#40;</span>adBookmark<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;SET<span style="color: #000000;">&#40;</span> _SET_DECIMALS, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//IF BOOKMARK NUMERIC IT COMES WITH DEFINED DECIMALS MUST SET IT TO 0</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// fix Lucas de Beltran 24.05.2015 for empty oRecordSet</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! <span style="color: #000000;">&#40;</span> oRecordSet:<span style="color: #000000;">Eof</span> .and. oRecordSet:<span style="color: #000000;">Bof</span> <span style="color: #000000;">&#41;</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;<span style="color: #00C800;">endif</span><br /><br />&nbsp;</div>[/code:334ypifg] Thank you.
ADO RDD xHarbour
Lucas, Did it work ? I only can test it here today with ADS LOCAL and although all get all bookmarks it only displays one in browse().
ADO RDD xHarbour
Antonio, No it didn´t. aBookMarks almost always get all the values matching the filter. But many times after SET FILTER command, the dbf is empty!!. Any possible clue?. Maybe, at oRecordSet:Filter instead of BookMarks use HHBRECNO numbers?.
ADO RDD xHarbour
Lucas, I assume that you placed a msgselect to inspect aBookmarks. Please note that aBookmarks order change accordingly to the index order. Here I always get all matches in aBookmarks. The problem is that only shows one in browse and does not navigate through all. I think it might have something to do with the var type variant of :bookmark. How can we set a variant type var? Please check this <!-- m --><a class="postlink" href="http://www.java2s.com/Code/VBA-Excel-Access-Word/Access/UsingBookmarkstoFilterRecords.htm">http://www.java2s.com/Code/VBA-Excel-Ac ... ecords.htm</a><!-- m -->
ADO RDD xHarbour
Antonio, Yes, I inspected aBookmarks and I saw that all matches were in aBookmarks. However, most of times I get no records. Please use MySQL instead of ADS. As far as I know, :Bookmark is managed by ADO itself: <!-- m --><a class="postlink" href="https://msdn.microsoft.com/es-es/library/windows/desktop/ms675862(v=vs.85">https://msdn.microsoft.com/es-es/librar ... 62(v=vs.85</a><!-- m -->).aspx So the alternative is to call the Filter with HBRECNO numbers. I beleive it may be safer, as Bookmarks sometimes provide wrong results as Mr. Nages pointed out.
ADO RDD xHarbour
Lucas, Acc to documentation with aduseclient bookmarks are always assured by ado. I cant test it today with Mysql only tomorrow. ado its taking care of bookmarks and yes sometimes they might have strange values because they are "variant" variable. But they are always correct in ado sense. We cant send hbrecno as bookmarks as bookmark is a internal variant ado var. I think the problem has to do with the corresponding "variant" type var between ado and (x)Harbour. Can you check with Nages?
ADO RDD xHarbour
Lucas, Please check this <!-- m --><a class="postlink" href="http://en.wikipedia.org/wiki/Variant_type">http://en.wikipedia.org/wiki/Variant_type</a><!-- m -->
ADO RDD xHarbour
Antonio, I did this test: [code=fw:1ffq0yax]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; &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; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> EVAL<span style="color: #000000;">&#40;</span> aFilterInfo<span style="color: #000000;">&#91;</span> UR_FRI_BEXPR <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AADD<span style="color: #000000;">&#40;</span> aBookMarks, oRecordSet:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aadd <span style="color: #000000;">&#40;</span> aRegistros, alltrim<span style="color: #000000;">&#40;</span> &nbsp;cValtochar<span style="color: #000000;">&#40;</span>oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span>ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br />&nbsp; &nbsp; &nbsp; &nbsp;SET<span style="color: #000000;">&#40;</span> _SET_DECIMALS, nDecimals <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span>aregistros<span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span> aRegistros <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;cFiltro += ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" = "</span> + aregistros<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> i != len<span style="color: #000000;">&#40;</span> aRegistros <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cFiltro += <span style="color: #ff0000;">" AND "</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">&#40;</span>cfiltro<span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">Filter</span> := cFiltro <span style="color: #B900B9;">//aBookMarks &nbsp; //ARRAY OF BOOKMARKS</span><br /><br />&nbsp;</div>[/code:1ffq0yax] I am still getting no records, despite cFiltro is ok. Maybe something with cursors?.
ADO RDD xHarbour
Lucas, Try set filter to fieldrecn = nrecno and fieldrecn =nrecno Does it works?
ADO RDD xHarbour
Lucas, Comment this in ado_setfilter [quote:1qt5cgfw] * ADO_GOTOID( nWA, nRecNo ) IF oRecordSet:Eof() //does not have this rec in filter lets gotop ADO_GOTOP(nWa) ENDIF */ [/quote:1qt5cgfw] Did it work?
ADO RDD xHarbour
Antonio, Yes!!, now commenting out such lines oRecordSet:Filter := aBookMarks works perfect!!!. Congratulations. I am going to send you an email with minor bugs. Thank you.
ADO RDD xHarbour
Lucas, I assume then you are using this: [code=fw:3pmx0ubq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&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; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> EVAL<span style="color: #000000;">&#40;</span> aFilterInfo<span style="color: #000000;">&#91;</span> UR_FRI_BEXPR <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AADD<span style="color: #000000;">&#40;</span> aBookMarks, oRecordSet:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aadd <span style="color: #000000;">&#40;</span> aRegistros, alltrim<span style="color: #000000;">&#40;</span> &nbsp;cValtochar<span style="color: #000000;">&#40;</span>oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span>ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br />&nbsp; &nbsp; &nbsp; &nbsp;SET<span style="color: #000000;">&#40;</span> _SET_DECIMALS, nDecimals <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span>aregistros<span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span> aRegistros <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;cFiltro += ADODEFLDRECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" = "</span> + aregistros<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> i != len<span style="color: #000000;">&#40;</span> aRegistros <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cFiltro += <span style="color: #ff0000;">" AND "</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">&#40;</span>cfiltro<span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">Filter</span> := cFiltro <span style="color: #B900B9;">//aBookMarks &nbsp; //ARRAY OF BOOKMARKS</span><br /><br />&nbsp;</div>[/code:3pmx0ubq] Its great that work but it doesnt seem a correct solution. If there are a couple thousand records will :Filter work with such long cFiltro? I doubt.
ADO RDD xHarbour
Antonio, No, I am using AADD( aBookMarks, oRecordSet:BookMark ) I think your approach is the same as SQLRDD. And also, we have Scopes, faster that Filters.
ADO RDD xHarbour
Lucas, Ok Great <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> I miss understood it Can you now try it with your app? It would be great to have your comments. Im going to try it myself tomorrow.
ADO RDD xHarbour
Antonio, I am already testing with my App. So that´s how I discovered most bugs and the one at dbseek(). Thank you.
ADO RDD xHarbour
New version adordd <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m -->
ADO RDD xHarbour
Antonio, DbFilter() does not return the filter expresión. Also, OrdSetFocus() when there is an active filter fails. Thank you.
ADO RDD xHarbour
Antonio, As you change position to HBRECNO at ADO_CREATE(), this fix is required to handle the array: [code=fw:2tfli1no]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp;fix to add HBRECNO if it´s not present &nbsp;// Lucas De Beltran 23.05.2015<br />&nbsp; &nbsp;cannot be first otherwise copy to changes all fields order and values ahf 23.5.2015<br /><br />&nbsp; &nbsp;Transposes the array to have only first row &nbsp;// Lucas de Beltran 24.05.2015<br />&nbsp; &nbsp;*/</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ASCAN<span style="color: #000000;">&#40;</span> ArrTranspose<span style="color: #000000;">&#40;</span> &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_SQLSTRUCT <span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>, ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span> &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_SQLSTRUCT <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> &nbsp;ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span> &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp;</div>[/code:2tfli1no]
ADO RDD xHarbour
Lucas, [quote:2wtatgr7] DbFilter() does not return the filter expresión. [/quote:2wtatgr7] Corrected! [quote:2wtatgr7]Also, OrdSetFocus() when there is an active filter fails.[/quote:2wtatgr7] Here seems to be working ok. Can you post an example? This is happening on version posted yesterday?
ADO RDD xHarbour
Lucas, [quote="lucasdebeltran":30v22exr]Antonio, As you change position to HBRECNO at ADO_CREATE(), this fix is required to handle the array: [code=fw:30v22exr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />   <span style="color: #B900B9;">/*<br />   fix to add HBRECNO if it´s not present  // Lucas De Beltran 23.05.2015<br />   cannot be first otherwise copy to changes all fields order and values ahf 23.5.2015<br /><br />   Transposes the array to have only first row  // Lucas de Beltran 24.05.2015<br />   */</span><br />   <span style="color: #00C800;">IF</span> ASCAN<span style="color: #000000;">&#40;</span> ArrTranspose<span style="color: #000000;">&#40;</span>  aWAData<span style="color: #000000;">&#91;</span> WA_SQLSTRUCT <span style="color: #000000;">&#93;</span>  <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>, ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span>  aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />      AADD<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_SQLSTRUCT <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span>  ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span>  aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'+'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br /> </div>[/code:30v22exr][/quote:30v22exr] I dont have arr_transpose.
ADO RDD xHarbour
Antonio, To debug OrdSetFocus(), I need the fix for dbfilter() please, to trace the problem. It my be related when appending of replacing records, the filter is cleared?. I don´t know if it happened before. About ArrayTranspose(), its aviable here: <!-- m --><a class="postlink" href="https://bitbucket.org/fivetech/fiveweb/src/f1d5073aae35f6945424f83ccb1369c2d9b0205b/source/function/harbour.prg?at=master">https://bitbucket.org/fivetech/fiveweb/ ... ?at=master</a><!-- m --> Also, at adordd.prg, can you please move all Fivewin functions to the bottom of the code?. Thank you.
ADO RDD xHarbour
Lucas, Check you email.
ADO RDD xHarbour
Lucas, Ordsetfocus() with filters seems to be working ok here. (MySql)
ADO RDD xHarbour
Antonio, And when the INDEX TAG has a condition?. Thank you.
ADO RDD xHarbour
Lucas, I didnt try it. As soon as I have some time we ll try it.
ADO RDD xHarbour
Antonio, Set filter is not working fine. aBookMarks is always is righ. However, sometimes I get only one record, when I should get three records. Even, at Browse I see three of them, but I i click on the browse, the cursor only shows one.
ADO RDD xHarbour
Lucas, Please try: 1st without indexes. Is it working ? 2nd indexes without condition. Is it working ? 3rd indexes with condition. Is it working ? Here with browse() 1st and 2nd working. (MYSQL) I suspect that has something to do with ado_reccount()
ADO RDD xHarbour
Lucas, Use this in adordd (i dont know if your version has already ADO_FILTERTEXT if not place this in ADORDD_GETFUNCTABLE aADOFunc[ UR_FILTERTEXT ] := (@ADO_FILTERTEXT()) and replace with this [code=fw:gypa73j8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_FILTERTEXT<span style="color: #000000;">&#40;</span>nWa,cFilterExp<span style="color: #000000;">&#41;</span><br />&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;<br />&nbsp;cFilterExp := aWAData<span style="color: #000000;">&#91;</span>WA_CFILTERACTIVE<span style="color: #000000;">&#93;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS<br />&nbsp;</div>[/code:gypa73j8] dbfilter() and dbinfo() return cfilter expression.
ADO RDD xHarbour
Antonio, OrdKeyCount() seems ok, but reccount() gets wrong results, adding more records that the ones concerning the filter. Have you tested with xBrowse().
ADO RDD xHarbour
Antonio, I tested same filter with DBFCDX and RecCount() also is different in DBFCDX from OrdKeyCount(). I am lost. This is how xBrowse sets the RDD: [code=fw:b409sfov]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> SetRDD<span style="color: #000000;">&#40;</span> lAddColumns, lAutoOrder, aFldNames, aRows <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br />   <span style="color: #00C800;">local</span> oCol, aStruct<br />   <span style="color: #00C800;">local</span> cAlias, cAdsKeyNo, cAdsKeyCount<br />   <span style="color: #00C800;">local</span> nFields, nFor, n, uData<br />   <span style="color: #00C800;">local</span> bOnSkip<br /><br />   <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">cAlias</span> := <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lCreated</span><br />      <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nDataType</span> == DATATYPE_RDD<br />         <span style="color: #00C800;">if</span> SameDbfStruct<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span>, <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">endif</span><br />      ::<span style="color: #000000;">cAlias</span> := <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">ClearBlocks</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">aCols</span>  := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">DEFAULT</span> lAddColumns      := Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span> .or. ! Empty<span style="color: #000000;">&#40;</span> aFldNames <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">DEFAULT</span> lAutoOrder       := ::<span style="color: #000000;">lAutoSort</span><br />   ::<span style="color: #000000;">lAutoSort</span>              := lAutoOrder<br /><br />   cAlias      := ::<span style="color: #000000;">cAlias</span><br />   <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> aRows <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'A'</span> .and. Len<span style="color: #000000;">&#40;</span> aRows <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br /><br />      <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> aRows<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: #ff0000;">'A'</span><br />         bOnSkip        := <span style="color: #000000;">&#123;</span> | oBrw | <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><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: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      <span style="color: #00C800;">else</span><br />         bOnSkip        := <span style="color: #000000;">&#123;</span> | oBrw | <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      <span style="color: #00C800;">endif</span><br />      ::<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aRows, .f., <span style="color: #000000;">0</span>, .f., bOnSkip <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">nDataType</span>       := nOr<span style="color: #000000;">&#40;</span> DATATYPE_RDD, DATATYPE_ARRAY <span style="color: #000000;">&#41;</span><br />      lAutoOrder        := .f.<br />   <span style="color: #00C800;">else</span><br />      ::<span style="color: #000000;">nDataType</span> := DATATYPE_RDD<br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #000000;">lSqlRDD</span> := <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RddName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"SQLRDD"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lSqlRDD</span><br />      <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bKeyNo</span>  := <span style="color: #000000;">&#123;</span> |n| <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bGoTop</span>    := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />           ::<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoBottom<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />           ::<span style="color: #000000;">bSkip</span>     := <span style="color: #000000;">&#123;</span>| n | <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSkipper<span style="color: #000000;">&#40;</span> IfNil<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />           ::<span style="color: #000000;">bBof</span>      := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> Bof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />           ::<span style="color: #000000;">bEof</span>      := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />           ::<span style="color: #000000;">bBookMark</span> := <span style="color: #000000;">&#123;</span>| n | iif<span style="color: #000000;">&#40;</span> n == <span style="color: #00C800;">nil</span>,;<br />                                     <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />                                     <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoto<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span>;<br />                                    <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #00C800;">If</span> <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADS"</span>$<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RddName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .or. <span style="color: #ff0000;">'ADT'</span> $ <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RddName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .and. ;<br />      <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> LastRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">200</span><br /><br />      <span style="color: #B900B9;">// Modified in FWH 9.06</span><br />      <span style="color: #B900B9;">// AdsGetRelKeyPos() returns approximate position as % and when multipilied by 100 and rounded off</span><br />      <span style="color: #B900B9;">// returns incorrect values occassionally on smaller  tables. OrdKeyNo() mapped to AdsKeyNo() gives reliable</span><br />      <span style="color: #B900B9;">// result in such cases. For large tables OrdKeyNo() is unacceptably slow. Limit of 200 is chosen because</span><br />      <span style="color: #B900B9;">// 0.5% is 1/200.</span><br /><br />      cAdsKeyNo    := <span style="color: #ff0000;">"{| n, Self | iif( n == nil, "</span> +;<br />                         <span style="color: #ff0000;">"Round( "</span> + cAlias + <span style="color: #ff0000;">"->( ADSGetRelKeyPos() ) * Self:nLen, 0 ), "</span>+;<br />                         cAlias + <span style="color: #ff0000;">"->( ADSSetRelKeyPos( n / Self:nLen ) ) ) }"</span><br /><br />      cAdsKeyCount := <span style="color: #ff0000;">"{|| "</span> + cAlias + <span style="color: #ff0000;">"->( ADSKeyCount(,,1) )}"</span><br /><br />      <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bKeyNo</span>    := &cAdsKeyNo ,;<br />              ::<span style="color: #000000;">bKeyCount</span> := &cAdsKeyCount<br /><br />      ::<span style="color: #000000;">lRelyOnKeyNo</span>      := .f.<br />   <span style="color: #00C800;">else</span><br />       <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bKeyNo</span>    := <span style="color: #000000;">&#123;</span>| n | iif<span style="color: #000000;">&#40;</span> n == <span style="color: #00C800;">nil</span>,;<br />                                        <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />                                        <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyGoto<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span>;<br />                                        <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />               ::<span style="color: #000000;">bKeyCount</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. bof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>, OrdKeyCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />      ::<span style="color: #000000;">lRelyOnKeyNo</span> := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Set<span style="color: #000000;">&#40;</span> _SET_DELETED <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"DELETED()"</span> $ Upper<span style="color: #000000;">&#40;</span> DbFilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Endif</span><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lSqlRDD</span><br />      ::<span style="color: #000000;">lRelyOnKeyNo</span>    := .f.<br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #000000;">lReadOnly</span>    := <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbInfo<span style="color: #000000;">&#40;</span> DBI_ISREADONLY <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == .t. <span style="color: #000000;">&#41;</span><br />   aStruct        := <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbstruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> lAddColumns<br />      <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> aFldNames <span style="color: #000000;">&#41;</span><br />         aFldNames   := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'*'</span> <span style="color: #000000;">&#125;</span><br />      <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">for</span> each uData in aFldNames<br />         <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> uData <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span> .and. uData == <span style="color: #ff0000;">'*'</span><br />            <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />               <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> SetColFromRDD<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nFor <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">next</span><br />         <span style="color: #00C800;">else</span><br />            <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> SetColFromRDD<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, uData, aStruct <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">next</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrderTagInfo<span style="color: #000000;">&#40;</span> aStruct, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> n := AScan<span style="color: #000000;">&#40;</span> aStruct, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == Upper<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />         ::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cSortOrder</span>    := aStruct<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span><br />         ::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cOrdBag</span>       := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdBagName<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cSortOrder</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">next</span> nFor<br /><br />   <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bSeek</span>  := <span style="color: #000000;">&#123;</span> |c,u| <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">RddIncrSeek</span><span style="color: #000000;">&#40;</span> c, @u <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbInfo<span style="color: #000000;">&#40;</span> DBI_SHARED <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">bLock</span>     := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbrLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      ::<span style="color: #000000;">bUnlock</span>   := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbrUnlock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #000000;">bDelete</span>   := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nLen</span> > <span style="color: #000000;">0</span> .and. Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bLock</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> DbDelete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bUnlock</span> <span style="color: #000000;">&#41;</span>, ;<br />                       <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Set<span style="color: #000000;">&#40;</span> _SET_DELETED <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, DbGoBottom<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> ;<br />                       <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cTitle</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">cTitle</span> := cFileNoExt<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBINFO<span style="color: #000000;">&#40;</span> DBI_FULLPATH <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lCreated</span><br />      ::<span style="color: #0000ff;">Adjust</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /> </div>[/code:b409sfov]
ADO RDD xHarbour
Lucas, I cant work with xBrowse() [code=fw:156dlp2y]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_RECCOUNT<span style="color: #000000;">&#40;</span> nWA, nRecords <span style="color: #000000;">&#41;</span><br />   <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>,nRecNo<br /><br />   <span style="color: #00C800;">IF</span> oRecordSet:<span style="color: #000000;">RecordCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> < <span style="color: #000000;">0</span><br />      nRecords := ADORECCOUNT<span style="color: #000000;">&#40;</span>nWA,oRecordSet<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// AHF SEE FUNCTION FOR EXPLANATION oRecordSet:RecordCount()</span><br />      <br />   <span style="color: #00C800;">ELSE</span><br />      ADO_RECID<span style="color: #000000;">&#40;</span>nWA,@nRecNo<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">IF</span> nRecNo > oRecordSet:<span style="color: #000000;">RecordCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         nRecords := nRecNo<br />      <span style="color: #00C800;">ELSE</span><br />         nRecords :=  oRecordSet:<span style="color: #000000;">RecordCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ENDIF</span>  <br />   <span style="color: #00C800;">ENDIF</span><br />   <br />   <span style="color: #00C800;">RETURN</span> HB_SUCCESS</div>[/code:156dlp2y] In order to avoid multiple calls of adoreccount Ive decided for this strategy. ADORECCOUT only gets called if :recordcount <0 //not supported Then because recno (autoinc field) can be greater than recordcount if it is we assume reccount as recno Otherwise reccount = recordcount if you place in a dynamic say connected to a browse "recno() / lastrec()" you will see that if recno is greater than recordcount recno and lastrec will be always the same. Maybe the logic its not correct. Without filters its ok.
ADO RDD xHarbour
Antonio, This is the same ADO_RECCOUNT() as current, isn´t it?. Why can´t you work with xBrowse()?. It was introduced since 2002-2003 in FWH.
ADO RDD xHarbour
Lucas, [quote:xah1ahgo]I tested same filter with DBFCDX and RecCount() also is different in DBFCDX from OrdKeyCount(). I am lost. [/quote:xah1ahgo] Im not sure what you mean. Recno() = record number in the table OrdKeyNo() record number in the index OrdKeyCount() = total records in the index (if index with condition this will never be the same as reccount) Reccount() = total records in the table The index records are logical so not the same as table records. In adordd OrdKeyNo = AbsolutePositon and OrdKeyCount = RecordCount LastRec Reccount = see function my previous post Recno = value of fieldrecno Does filter works without indexes? Here ok Does filter works with indexes without conditions? Here ok Does Filter works with indexes with conditions? didnt try but it should since the filter its applied to the recordset and the recordset its build with where clause matching index condition. All this without adding or changing keys being filtered. So in xbrowse what is your bskip ? ::bSkip := {| n | ( ::cAlias )->( DbSkipper( IfNil( n, 1 ) ) ) },; adordd should be treated as any dbf rdd.
ADO RDD xHarbour
Lucas, Try this: [code=fw:3668syet]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USE table<br />&nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"total recs "</span>+str<span style="color: #000000;">&#40;</span>lastrec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" ordkeycount "</span>+str<span style="color: #000000;">&#40;</span>ordkeycount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;SET FILTER <span style="color: #0000ff;">TO</span> whatever<br />&nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"total recs "</span>+str<span style="color: #000000;">&#40;</span>lastrec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" ordkeycount "</span>+str<span style="color: #000000;">&#40;</span>ordkeycount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">" recno "</span>+str<span style="color: #000000;">&#40;</span>recno<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" total recs "</span>+str<span style="color: #000000;">&#40;</span>lastrec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" ordkeycount "</span>+str<span style="color: #000000;">&#40;</span>ordkeycount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; skip<br />&nbsp;<span style="color: #00C800;">enddo</span><br />&nbsp;</div>[/code:3668syet] what did you get?
ADO RDD xHarbour
Antonio, [quote:2lubf822]adordd should be treated as any dbf rdd.[/quote:2lubf822] Yes, it should be but in fact does not. The problem happens when the filter cover more that one record. With one record is fine. Also, it happens only with xBrowse(). Which version of Fivewin are you using?. Thank you.
ADO RDD xHarbour
Lucas, Fivewin october 2008 I think this is not implemented in adordd ! This is not used in our converted app. [code=fw:1897shhx]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; <br />bKeyNo,; &nbsp; &nbsp; <span style="color: #B900B9;">// SETGET codeblock to be used for positioning the vertical scrollbar</span><br /><br /><span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bKeyNo</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>| n | iif<span style="color: #000000;">&#40;</span> n == <span style="color: #00C800;">nil</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#91;</span>b<span style="color: #000000;">&#93;</span>OrdKeyGoto<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span>/b<span style="color: #000000;">&#93;</span>;<br /><br />&nbsp;</div>[/code:1897shhx] Are you using this? So it did function in browse() and in my previous example?
ADO RDD xHarbour
Antonio, I sent you an email with a test function for xBrowse(). Browse() sometimes fails, less than xBrowse(), but also Browse() sometimes does not reflect all records within a FIlter.
ADO RDD xHarbour
Lucas, Ok Ill check it. Did this function? [code=fw:33fqeltt]<div class="fw" id="{CB}" style="font-family: monospace;">USE table<br />&nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"total recs "</span>+str<span style="color: #000000;">&#40;</span>lastrec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" ordkeycount "</span>+str<span style="color: #000000;">&#40;</span>ordkeycount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;SET FILTER <span style="color: #0000ff;">TO</span> whatever<br />&nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"total recs "</span>+str<span style="color: #000000;">&#40;</span>lastrec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" ordkeycount "</span>+str<span style="color: #000000;">&#40;</span>ordkeycount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">" recno "</span>+str<span style="color: #000000;">&#40;</span>recno<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" total recs "</span>+str<span style="color: #000000;">&#40;</span>lastrec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" ordkeycount "</span>+str<span style="color: #000000;">&#40;</span>ordkeycount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; skip<br />&nbsp;<span style="color: #00C800;">enddo</span></div>[/code:33fqeltt]
ADO RDD xHarbour
Lucas, I notice in your code [code=fw:6suzfljc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TAG DELETED <span style="color: #0000ff;">TO</span> TMP MEMORY ADDITIVE<br />&nbsp; &nbsp; OrdSetFocus<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// this does nothing</span><br />&nbsp; &nbsp;place my func check state here<br />&nbsp;</div>[/code:6suzfljc] adordd creates the index but does not opened. You must issue SET INDEX TO. Isnt this the normal procedure with other rdds ? Ive post a function to check the state of all tables in previous post. Can you use it there and see.
ADO RDD xHarbour
Antonio, The full statement is: [code=fw:bq83a6le]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> uData <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RDDNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'DBFCDX'</span> .and. <span style="color: #000000;">&#40;</span> uData <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> uData <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> LastRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <= <span style="color: #000000;">1000</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> uData <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> MakeTmpIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp;</div>[/code:bq83a6le] So the MakeTmpIndex() is not executed as RDDNAME() is not DBFCDX.
ADO RDD xHarbour
Lucas, Ive made a small and I think that we cant use :find on :filter dont know why and its doesnt make sense but all indicates to that. After using :find with :filter recordset goes nuts. Does Mr. Rao knows anything about this ? Ill try tomorrow a workaround.
ADO RDD xHarbour
Lucas, Check your email new adordd with filters working. The problem was with :find that you cant use with active :filter. Please try it and let me know results. Thanks.
ADO RDD xHarbour
Lucas, ConnectionTimeout does not function the way we needed this only avoids the timeout default of 15s of ado. If you set it to 0 ado will try forever otherwise throws error. I think we should set it to 60 seconds then ask the user if he likes to continue trying. The DBA from our client advise us to do the following: Place a timer pinging to the server When it fails close the connection and open a new one. The recordsets should remain ok I just don't know if then we would need a :filter to have all pending records updates and to skip through all of them issuing the updates failed during the time of the lost connection. Or Configure the OleDb or ODBC to avoid that enabling automatic reconnect. How can we catch the connection lost error? Do you or anyone have any experience with this. Mr Rao? Enrico? Rick?
ADO RDD xHarbour
Antonio, Filters seem to be working ok. I have to do more tests. Congrats !!. Also, I have to say that your ADORDD is much faster than SQLRDD from xHarbour.com and Patrick Mast. Thank you.
ADO RDD xHarbour
Lucas, I just emailed you a new version with: Filters with updates and addnew and indexes completed. Index on now adds the index to the opened indexes list. You can use after just ordsetfocus(). Please check it and let me know your findings. [quote:2wmv36bo]Also, I have to say that your ADORDD is much faster than SQLRDD from xHarbour.com and Patrick Mast.[/quote:2wmv36bo] Great to know. Just got from the trials in our client that the speed might be much improved in relations were we are querying with select the table and now we are trying using a clone set with :filter finding the recno in the main set. Also there is a problem in the connection property "Maximum Open Rows" that we cannot set because iits always read only. This prop together with CacheSize has a huge impact on select * in big tables. We are trying to find how to do it. Do you have any knowledge about this? Maybe Mr Rao. Concerning lost connections see my email. Thanks.
ADO RDD xHarbour
Antonio, With the version you send me a coupple of hours ago, filters are failing again.
ADO RDD xHarbour
Lucas, Sorry it was my mistake. Please see my email.
ADO RDD xHarbour
Lucas, Concerning connection lost control I just receive a information from our client to try this way: Timer issuing a dummy query to the server or checking state of the connection. If it fails "locks" immediately all updates to the recordset and only "unlocks" updates when the connection come back again. I hope this is possible. It seems that since the actual connection is lost any pending transactions will be rolled back. (this is with their server) I dont know if it is like this elsewhere. Thus we are going this way. Does anynone has any other better alternative?
ADO RDD xHarbour
Lucas, Concerning eval error this only happens when you dont have a active filter Right?
ADO RDD xHarbour
Yes.
ADO RDD xHarbour
Antonio, [quote="AHF":252jd9sa]How can we catch the connection lost error? Do you or anyone have any experience with this. Mr Rao? Enrico? Rick?[/quote:252jd9sa] What about TRY/CATCH/END? EMG
ADO RDD xHarbour
Enrico, Thanks but we choose other way. adordd will use a timer to keep connection live. And a test in certain routines to see if it is connected otherwise it let you do anything but: Updates, New records, changing index orders You will continue to work disconnected and as soon as you get connected again everything comes back to normal operation. With this we hope to avoid lost connection for the lack of activity Nevertheless if you loose con you continue to work but with some limitations I didnt try it yet.
ADO RDD xHarbour
Antonio, There are the post I was refering to: <!-- m --><a class="postlink" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=26907&start=0&hilit=recordset+local">http://forums.fivetechsupport.com/viewt ... dset+local</a><!-- m --> <!-- l --><a class="postlink-local" href="http://fivetechsupport.com/forums/viewtopic.php?f=3&t=28763&p=161538&hilit=ado#p161538">viewtopic.php?f=3&t=28763&p=161538&hilit=ado#p161538</a><!-- l --> Thanks.
ADO RDD xHarbour
Antonio, xBrowse feature wildseek is not working. When you type values, it filters, but when you start deleting such value filtered records are still on xbrowse. Please test this code with DBFCDX and ADORDD: At. [b:2s2awiej]:cFilterFld [/b:2s2awiej]:= "FIRST" you have to indicate the field you want to filter for. [code=fw:2s2awiej]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">function</span> testWildSeek<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oCbx, oFont, nWild := <span style="color: #000000;">2</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nOpt &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">1</span><br /><br /><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">900</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test WildSeek v. 3 "</span>+FWVERSION ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">30</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE cAlias <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br /><br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br /><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> := <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lIncrFilter</span> &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lSeekWild</span> &nbsp; &nbsp; := .t. <br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">cFilterFld</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"FIRST"</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStretchCol</span> &nbsp; := STRETCHCOL_WIDEST<br /><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br /><br /><span style="color: #B900B9;">/*<br />&nbsp; &nbsp;@ 10,10 COMBOBOX nOpt PROMPTS { "Starting With", "Containing" } ;<br />&nbsp; &nbsp; &nbsp; SIZE 60,44 PIXEL OF oDlg &nbsp;;<br />&nbsp; &nbsp; &nbsp; ON CHANGE ( oBrw:lSeekWild := ( nOpt == 2 ), ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:Seek( If( oBrw:lSeekWild, oBrw:cSeek, "" ) ),;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:Refresh(), oBrw:SetFocus() )<br />*/</span><br /><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">SAY</span> oBrw:<span style="color: #000000;">oSeek</span> <span style="color: #0000ff;">PROMPT</span> oBrw:<span style="color: #000000;">cSeek</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">COLOR</span> CLR_RED,CLR_YELLOW<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">BUTTON</span> &nbsp;<span style="color: #ff0000;">"Clean xBrowse WildSeek"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">350</span> <span style="color: #0000ff;">BUTTON</span> &nbsp;<span style="color: #ff0000;">"DbClearFilter()"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> msgalert<span style="color: #000000;">&#40;</span> dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"ACTIVE FILTER"</span> <span style="color: #000000;">&#41;</span>, dbclearfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br />&nbsp;</div>[/code:2s2awiej] Thank you.
ADO RDD xHarbour
Stay tuned adordd its ready and Ill post new version later today.
ADO RDD xHarbour
Adordd its ready to work at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> It has been in development since Feb 2015 and being tested on real application working in parallel with the actual application with ADS and passed all trials. This app with adordd its now being tested intensive on concurrent access to check locking scheme and exclusive use. Will report results end next week. With adordd you can migrate immediately to any SQL server although all the trials have been made only with ADS, MySql and MS Access. No change code required. Except: 1) As with ADS in index expressions you have to evaluate vars before send it to adordd. 2) Delete records are immediately removed from table and cant be recovered again. So code like: [code=fw:29swpm0v]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Delete record recno<br />BlankRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//this will not work either comment it or place it before delete.</span><br /><br />delete all &nbsp;<span style="color: #B900B9;">//this will not work take it from here</span><br /><span style="color: #00C800;">while</span>....<br />&nbsp;<span style="color: #00C800;">if</span> lcondition &nbsp;<span style="color: #B900B9;">//change condition to not</span><br />&nbsp; &nbsp;recall record &nbsp;<span style="color: #B900B9;">//delete each record here</span><br />&nbsp;<span style="color: #00C800;">endif</span><br />end<br />&nbsp;</div>[/code:29swpm0v] Thats it! But you can do much more: [code=fw:29swpm0v]<div class="fw" id="{CB}" style="font-family: monospace;"><br />hb_GetAdoConnection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"CREATE VIEW cView ...."</span><span style="color: #000000;">&#41;</span><br /><br />sele <span style="color: #000000;">0</span><br />use cView<br /><br />Browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:29swpm0v] True locks as any other rdd. Upload tables to any Sql server just like: [code=fw:29swpm0v]<div class="fw" id="{CB}" style="font-family: monospace;"><br />use table VIA <span style="color: #ff0000;">"DBFCDX"</span><br />copy <span style="color: #0000ff;">to</span> sqltable via <span style="color: #ff0000;">"ADORDD"</span><br /><br />&nbsp;</div>[/code:29swpm0v] Performance its quite good. No Sql knowledge needed unless you want to use and run sql statements directly from ado functions. You write code exactly the same as any other rdd. With adordd we are free from all kind of limitations with tables and index management already in actual and future operating systems and will extend the life of our applications further. Although ADO it already today an "old" framework I think it will stay around for the next coming years (I hope so) Ill give support to it as long as you can supply precise ideas and sample code where something has not been foreseen in adordd scope of action. I hope that it will do the job for you all as it does for me.