topic
stringlengths
1
63
text
stringlengths
1
577k
ADO RDD xHarbour
Antonio, What this needed for: [code=fw:1gy1fax3]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_RAWLOCK<span style="color: #000000;">&#40;</span> nWA, nAction, nRecNo <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* TODO */</span><br /><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nRecNo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nAction <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS</div>[/code:1gy1fax3]
ADO RDD xHarbour
Antonio, FieldLen and FieldSize return nil I've tested in the adorrd before UR_SUPER_ADDFIELD( nWA, aField ) and the values are correct. What can we do?
ADO RDD xHarbour
Antonio, It seems that in usrrdd.c are missing some functions like FieldSize FieldLen Dbrlocklist. Shouldnt these also be there?
ADO RDD xHarbour
[quote="AHF":19z7vnbu]Antonio, What this needed for: [code=fw:19z7vnbu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_RAWLOCK<span style="color: #000000;">&#40;</span> nWA, nAction, nRecNo <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]</span><br /><br />   <span style="color: #B900B9;">/* TODO */</span><br /><br />   HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nRecNo <span style="color: #000000;">&#41;</span><br />   HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />   HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span> nAction <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">RETURN</span> HB_SUCCESS</div>[/code:19z7vnbu][/quote:19z7vnbu] It does nothing but it is needed. In case that you need it to do something, then you can implement it.
ADO RDD xHarbour
Antonio, You should download the complete source code for the harbour RDDs and use it to review the RDD code: [url:101t5fci]https&#58;//github&#46;com/harbour/core/tree/master/src/rdd[/url:101t5fci]
ADO RDD xHarbour
Antonio, I dont have any c expert and even so it would be dificult to understand it without proper documentation. In order to proceed I need the following functions working: OrdFor() FieldSize() or FieldLen() FieldDec() DbrlockList() I'm in a dead end ! What do you propose?
ADO RDD xHarbour
Antonio, Its not a matter of knowing C, instead it is a matter of properly searching <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> You asked for OrdFor(). 1. Is there a UR_FOR or similar in harbour\include\hbusrrdd.ch ? I find this: /* DBSCOPEINFO */ #define UR_SI_BFOR 1 #define UR_SI_CFOR 2 Also: /* DBORDERCONDINFO */ #define UR_ORC_ACTIVE 1 #define UR_ORC_CFOR 2 2. Have we implemented those functions in adordd.prg ? 3. In SQL we may need to store a string cFor value only, no need for the codeblock. I know this is not easy, but slowly we can keep going...
ADO RDD xHarbour
Antonio, [quote:3abooj16]1. Is there a UR_FOR or similar in harbour\include\hbusrrdd.ch ?[/quote:3abooj16] As far as I see no. [quote:3abooj16]3. In SQL we may need to store a string cFor value only, no need for the codeblock.[/quote:3abooj16] Its absolutly necessary to build the selects respecting indexes order and conditions. If the index is created (temporary) then on ADO_CREATE we have all info we just save it for later use. If the index its usual then it must be defined previously in the index array. So the problem its only with ordfor() to get the values saved. [quote:3abooj16]2. Have we implemented those functions in adordd.prg ?[/quote:3abooj16] What do you mean by those functions ? I can have such a function(s) but then I will disrupt other linked rdds, besides that since we dont have nWA we can not use it like (alias)->(ordfor(2)) [code=fw:3abooj16]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> OrdFor<span style="color: #000000;">&#40;</span>nOrder<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">//works only for current selected &nbsp;workarea not alias->(ordfor(n))</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> cTablename := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> aWAData := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> cFor := <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> nOrder = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;nOrder := aWAData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;cFor := aWAData<span style="color: #000000;">&#91;</span>WA_INDEXFOR<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>nOrder<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; ELSEIF nOrder <= LEN<span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span>WA_INDEXES<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;cFor := aWAData<span style="color: #000000;">&#91;</span>WA_INDEXFOR<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>nOrder<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span>&nbsp; &nbsp;<br />&nbsp; &nbsp; <br />&nbsp;<span style="color: #00C800;">RETURN</span> cFor<br />&nbsp;</div>[/code:3abooj16] I think all mentioned functions must be defined at rdd level to be used correctly as they probably are in dbfcdx rdd for ex. The adordd its working already with "indexes" with zero app code change and if you get an error you will have all area info. [code=fw:3abooj16]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;<span style="color: #000000;">20</span>: &nbsp; &nbsp;<span style="color: #000000;">ENCCLIST</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NomeRDD: <span style="color: #000000;">ADORDD</span><br />&nbsp; &nbsp; &nbsp;==============================<br />&nbsp; &nbsp; &nbsp;RecNo &nbsp; &nbsp;RecCount &nbsp; &nbsp;BOF &nbsp; EOF<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">34</span> &nbsp; &nbsp; &nbsp;.F. &nbsp; .F.<br /><br />&nbsp; &nbsp; &nbsp;Índices em uso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TagName<br />&nbsp; &nbsp; &nbsp; &nbsp; => NRENCOMEND+CODIGOPROD+ARMAZEM &nbsp; &nbsp; &nbsp;ENCCPRO<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CODIGOPROD+ARMAZEM+NRENCOMEND &nbsp; &nbsp; &nbsp;PROENCC<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GUIA+CODCLIENTE+CODIGOPROD+ARMAZEM MECPD<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CODCLIENTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CDENCCL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NRFACTUR+CODCLIENTE+CODIGOPROD+ARMA PTFACT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NRFACTUR+CODIGOPROD+ARMAZEM+ANO +SE NRFPROD<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CODIGOPROD+NRCONTRATO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CCONTRT<br /><br />&nbsp; &nbsp; &nbsp;Relações em uso <br />&nbsp; &nbsp; &nbsp; &nbsp; Registos fechados <br /><br />&nbsp;<span style="color: #000000;">30</span>: => OFERTAS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NomeRDD: <span style="color: #000000;">ADORDD</span><br />&nbsp; &nbsp; &nbsp;==============================<br />&nbsp; &nbsp; &nbsp;RecNo &nbsp; &nbsp;RecCount &nbsp; &nbsp;BOF &nbsp; EOF<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">3</span> &nbsp; &nbsp; &nbsp;.F. &nbsp; .F.<br /><br />&nbsp; &nbsp; &nbsp;Índices em uso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TagName<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CODCLIENTE+CODIGOPROD+ARMAZEM+DATAO CLIPRO<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CODIGOPROD+ARMAZEM+CODCLIENTE+DATAO PROCLI<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CODCLIENTE+DATAOFERTA +NUMEROOFER+C &nbsp;CLIPRO2<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CODIGOPROD+ARMAZEM+DATAOFERTA +NUME PROCLI2<br />&nbsp; &nbsp; &nbsp; &nbsp; => CODCLIENTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TEMP2<br /><br />&nbsp; &nbsp; &nbsp;Relações em uso <br />&nbsp; &nbsp; &nbsp; &nbsp; Registos fechados <br />&nbsp;</div>[/code:3abooj16] Dont get me wrong its not a matter of difficulty but if its in fact possible to work with our approach idea and that we are not simply loosing time as we are trying to join together two completly diferent worlds xBase and SQL. Besides that we have till June to have such a solution. Is there some rdd expert that could help us? How can we solve this? Can you check how its working in other rdds?
ADO RDD xHarbour
Antonio, I never looked at .ch. I understand now how it works. Ive define UR_INFO and now I get the call from dbrlocklist do get the array. We re back again
ADO RDD xHarbour
Antonio, Very good! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, if you post here or provide a url to download your most recent version, I guess many users may be interested in testing it and surely will provide a great feedback <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, Ill do that maybe today after finish all locking, seeks and finds. Dbrlocklist() and Dbinfo() are working <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> . Ive checked the paramaters in hbusrdd.c [code=fw:37k6o3kx]<div class="fw" id="{CB}" style="font-family: monospace;">hb_usrInfo<span style="color: #000000;">&#40;</span> AREAP pArea, HB_USHORT uiInfoType, PHB_ITEM pInfo <span style="color: #000000;">&#41;</span></div>[/code:37k6o3kx] Can I assume that when we have pSomeVar its always a pointer thus passed by reference? Thus in this case ADO_ORDERINFO(nWa, nInfo, uReturn) uReturn passed reference The Recno() only works with :Bookmarks as: [code=fw:37k6o3kx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRecno := oRecordSet:<span style="color: #000000;">BookMark</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// iif( oRecordSet:AbsolutePosition == -3, oRecordSet:RecordCount() + 1, oRecordSet:AbsolutePosition )</span><br />&nbsp;</div>[/code:37k6o3kx] The commented line was in previous adordd but I think its safer like this. Do you agree?
ADO RDD xHarbour
Antonio, yes I think it is fine. You are doing a great work, congratulations! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Once you complete it, you could provide it to Harbour dev team so it will get updated in the Harbour official repository and you will become an official Harbour contributor <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, In order to finish network and concurrent activity I need to work with transactions. For that I need to know if in ADORDD each time we open a new recordset its in the same connection. Its crucial to know this because transactions are per connection. Do you have any idea how to test that?
ADO RDD xHarbour
Antonio, AS far as I know I would say yes, but Mr. Rao is the right one to confirm us this <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, Ive already ask him in my oyher post ADO exclusive open. It seems that in the source of tdatarow we could check that.
ADO RDD xHarbour
very good <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> I really wish that this ADO RDD gets completed and you are doing a great job <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> AdoRdd will become a great tool for harbour/xHarbour users
ADO RDD xHarbour
Antonio, Do you have idea what function OrdKeyNo and OrdKeyCount are calling in RDD ? Can you help me find that ? I cannot find it! Concerning the indexes with FOR clause to be transformed to WHERE clause for SQL. Is it common to be used in predefined indexes or only temporary indexes? In our app we use it only in temporary indexes thus in the array of predefined indexes this situation is not forseen. Do yo think its worth to cover it also?
ADO RDD xHarbour
Antonio, [code=fw:447wvecn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ORDKEYNO <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;AREAP pArea = <span style="color: #000000;">&#40;</span> AREAP <span style="color: #000000;">&#41;</span> hb_rddGetCurrentWorkAreaPointer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; DBORDERINFO pOrderInfo;<br />&nbsp; &nbsp; &nbsp; memset<span style="color: #000000;">&#40;</span> &pOrderInfo, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">&#40;</span> pOrderInfo <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; pOrderInfo.itmOrder = hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, HB_IT_STRING | HB_IT_NUMERIC <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; pOrderInfo.atomBagName = hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, HB_IT_STRING <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">/* Either or both may be NIL */</span><br />&nbsp; &nbsp; &nbsp; pOrderInfo.itmNewVal = <span style="color: #00C800;">NULL</span>;<br />&nbsp; &nbsp; &nbsp; pOrderInfo.itmResult = hb_itemPutNL<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NULL</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; SELF_ORDINFO<span style="color: #000000;">&#40;</span> pArea, DBOI_POSITION, &pOrderInfo <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_itemReturnRelease<span style="color: #000000;">&#40;</span> pOrderInfo.itmResult <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; hb_errRT_DBCMD<span style="color: #000000;">&#40;</span> EG_NOTABLE, EDBCMD_NOTABLE, <span style="color: #00C800;">NULL</span>, HB_ERR_FUNCNAME <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span></div>[/code:447wvecn]
ADO RDD xHarbour
[code=fw:epbobjsd]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ORDKEYCOUNT <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;AREAP pArea = <span style="color: #000000;">&#40;</span> AREAP <span style="color: #000000;">&#41;</span> hb_rddGetCurrentWorkAreaPointer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; DBORDERINFO pOrderInfo;<br />&nbsp; &nbsp; &nbsp; memset<span style="color: #000000;">&#40;</span> &pOrderInfo, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">&#40;</span> pOrderInfo <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; pOrderInfo.itmOrder = hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, HB_IT_STRING | HB_IT_NUMERIC <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; pOrderInfo.atomBagName = hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, HB_IT_STRING <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">/* Either or both may be NIL */</span><br /><br />&nbsp; &nbsp; &nbsp; pOrderInfo.itmResult = hb_itemPutNL<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NULL</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; SELF_ORDINFO<span style="color: #000000;">&#40;</span> pArea, DBOI_KEYCOUNT, &pOrderInfo <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_itemReturnRelease<span style="color: #000000;">&#40;</span> pOrderInfo.itmResult <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; hb_errRT_DBCMD<span style="color: #000000;">&#40;</span> EG_NOTABLE, EDBCMD_NOTABLE, <span style="color: #00C800;">NULL</span>, HB_ERR_FUNCNAME <span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #000000;">&#125;</span></div>[/code:epbobjsd]
ADO RDD xHarbour
[url:1tsz28ls]https&#58;//github&#46;com/harbour/core/tree/master/src/rdd[/url:1tsz28ls]
ADO RDD xHarbour
FOR clause could be saved as a string and when you issue a SELECT command then you append FOR ... SELECT * FROM customers FOR ...
ADO RDD xHarbour
Antonio, Thanks I think see it now its ORDINFO <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> All locking already finished and it seems 100% compatible <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> FOR and UNIQUE on indexes are working Its translate to WHERE clause and DISTINCT CLAUSE in selects. <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> We are now taking care of : SCOPES to SELECT WHERE field BETWEEN value1 AND value2 Index clause NEXT translate to TOP n but for ex Oracle its ROWNUM we are checking how to solve these diferences between different SQLs SEEK and FIND SQLPARSER that we use already in other applications for ADS that transforms a normal old clipper filter expression to SQL SELECT taking in consideration active index. I have a deadline for this part of the project to 27.03 so I hope to have all done till Friday and Ill post "clean" code after. Still Fieldinfo its not working as we want. There are still problems with lenght and decimal places of DBF numeric fields types. Can you find out with Mr Rao how to know or force that all recordsets are opened with the same connection obj. This is imperative for transactions for locking concurrency Now we ve a demand to prevent 100% SQL INJECTION. I have to study this ? Do you or Mr Rao have any ideas? Cross your fingers as the most dificult part is still to come (RELATIONS)
ADO RDD xHarbour
Antonio, I just sent an email to Mr. Rao asking him for his help. You have all my support, hopefully you complete it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, Mr. Rao already answered me this: [quote:35fs1woa]1) Syntax of USE ... and DBUSEAREA. 2) Is the recordset opened by the ADORDD? If so how does the ADORDD knows the connection object? If ADORDD opens the recordset, does it open with connectionstring or a connection object?[/quote:35fs1woa] Please answer whatever you know regarding these questions, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, [quote:1qpsyzz4]1) Syntax of USE ... and DBUSEAREA. [/quote:1qpsyzz4] Exactly the same as for other Rdds [quote:1qpsyzz4]2) Is the recordset opened by the ADORDD? [/quote:1qpsyzz4] Yes. With ADO_OPEN( nWA, aOpenInfo ) [quote:1qpsyzz4]If so how does the ADORDD knows the connection object?[/quote:1qpsyzz4] Its ADRDD that opens the connection object each time USE gets called aWAData[ WA_CONNECTION ] := TOleAuto():New( "ADODB.Connection" ) [quote:1qpsyzz4]If ADORDD opens the recordset, does it open with connectionstring or a connection object?[/quote:1qpsyzz4] It does it with connection object opened as indicated above. oRecordSet:Open( aWAData[ WA_TABLENAME ], aWAData[ WA_CONNECTION ]) The problem is if I save the connection object in a STATIC var and I use it for the next call to open new recordset the app crashes.
ADO RDD xHarbour
Antonio, Do you mean this value ? aWAData[ WA_CONNECTION ] so you can't reuse it ? thanks
ADO RDD xHarbour
Maybe you are closing it somewhere ?
ADO RDD xHarbour
Antonio, The object its saved in the STATIC oADODB and its not released elsewere. [code=fw:1j8nfits]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">STATIC</span> oADODB :=<span style="color: #ff0000;">""</span><br /><br /><span style="color: #00C800;">FUNCTION</span> ADO_OPEN<span style="color: #000000;">&#40;</span>.....<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span>oADODB<span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//only first time</span><br />&nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> := &nbsp;TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Connection"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">OPEN</span><span style="color: #000000;">&#40;</span>.....<br />&nbsp; &nbsp; &nbsp; &nbsp;oADODB := aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> :=oADODB <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span> &nbsp; <br />&nbsp; &nbsp;oRecordSet := &nbsp;TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oRecordSet:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span>, oADODB<span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:1j8nfits]
ADO RDD xHarbour
Antonio, Where is it crashing ? Have you traced the code to check where it crashes ? Please place some MsgInfo()s or use OutputDebugString( cMsg ) (remember to load dbwin32.exe first).
ADO RDD xHarbour
Antonio, oRecordSet:Open(...
ADO RDD xHarbour
Antonio, I am checking the properties and methods of the ADO Connection object: [url:2d9z31i7]https&#58;//msdn&#46;microsoft&#46;com/en-us/library/windows/desktop/ms681546(v=vs&#46;85)&#46;aspx[/url:2d9z31i7] Please do a MsgInfo( oADODB:State ) before opening the recordset
ADO RDD xHarbour
Antonio, We just found out that : RecordCount isnt always accurate: with adUseServer (cursor supported by the provider) always return the total nr of records in table even if there is a where clause in the select like Reccount() with adUseClient (MS ccursor ) always return the true nr of rows in the recordset Thus the OrdKeyCount mainly needed for scrollbars will not function properly with adUseServer cursor!
ADO RDD xHarbour
Antonio, Many thanks for your great feedback <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, OrdKeyCount and RECORDCOUNT might be a problem! The only way to solve this is to: If we use always adUseClient because ADO knows all rows and there ist any problem but performance decreases a lot. Not advisable! IF we use adUseServer then with a WHERE clause ADO returns wrong RECORDCOUNT and OrdKeyCount! The only solution we for this is : If there is a WHERE clause we have to query the table with SELECT COUNT(*) FROM ctable WHERE .... Thus in each RECORDCOUNT and OrdKeyCount values are correct. We replace RECORDCOUNT by the following code: [code=fw:3k3oh5zu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADORECCOUNT<span style="color: #000000;">&#40;</span>nWA,oRecordSet<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//AHF</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aAWData := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oCon := aAWData<span style="color: #000000;">&#91;</span>WA_CONNECTION<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nCount := <span style="color: #000000;">0</span>, cSql:=<span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> oRecordSet:<span style="color: #000000;">CursorLocation</span> == adUseClient<br />&nbsp; &nbsp; &nbsp; nCount := &nbsp;oRecordSet:<span style="color: #000000;">RecordCount</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span>aAWData<span style="color: #000000;">&#91;</span>WA_INDEXES<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> .AND. aAWData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//Making it lightning faster</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">CursorLocation</span> := adUseServer<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">CursorType</span> := adOpenForwardOnly<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRsecordSetLockType := adLockReadOnly<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//LAST PARAMTER INSERTS cSql COUNT(*) MUST BE ALL FIELDS BECAUSE IF THERE IS A NULL &nbsp; &nbsp; &nbsp; &nbsp; </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//FIELD COUNTS RETURNS WRONG</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql := IndexBuildExp<span style="color: #000000;">&#40;</span>aAWData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span>,aAWData,.T.<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//INCLUDE COUNT</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"adoreccount 2 "</span>+CSQL<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//LETS COUNT IT</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">open</span><span style="color: #000000;">&#40;</span>cSql,oCon<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCount := oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"adoreccount 3 NRREC "</span>+CVALTOCHAR<span style="color: #000000;">&#40;</span>NCOUNT<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//RETURNING TO DEFAULT DATA</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">CursorType</span> := adOpenDynamic<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">CursorLocation</span> := adUseServer <span style="color: #B900B9;">//adUseClient never use ths very slow!</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">LockType</span> := adLockPessimistic<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql := IndexBuildExp<span style="color: #000000;">&#40;</span>aAWData<span style="color: #000000;">&#91;</span>WA_INDEXACTIVE<span style="color: #000000;">&#93;</span>,aAWData,.F.<span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//.F. DONT INCLUDE COUNT</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"adoreccount 4 "</span>+CSQL<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">open</span><span style="color: #000000;">&#40;</span>cSql,oCon<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCount := &nbsp;oRecordSet:<span style="color: #000000;">RecordCount</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> nCount &nbsp; <br /><br />&nbsp;</div>[/code:3k3oh5zu] Do you have any other alternative? This function its called a lot and I dont know what will be effect in the overall performance. In our small trials it seems ok but ..... I miss good old DBF or ADS:(
ADO RDD xHarbour
Antonio, As far as I know oRs:RecordCount() returns the number of records of the recordset so if you use a WHERE clause then you get less records. Lets ask Mr. Rao
ADO RDD xHarbour
Antonio, [quote="AHF":135057oe]If we use always adUseClient because ADO knows all rows and there ist any problem but performance decreases a lot.[/quote:135057oe] Using adUseClient the performance is better than adUseServer! EMG
ADO RDD xHarbour
Enrico, [quote="Enrico Maria Giordano":14svmhi4]Antonio, [quote="AHF":14svmhi4]If we use always adUseClient because ADO knows all rows and there ist any problem but performance decreases a lot.[/quote:14svmhi4] Using adUseClient the performance is better than adUseServer! EMG[/quote:14svmhi4] What DB you use? adUseClient would be much easier for adordd (bookmarks etc) but everything I read covering this indicates that adUseClient its much slower and should be avoid. Please note that the I'm using SELECT * FROM ... in adordd thats its really not good SQL practice but compatibility much be achieved.
ADO RDD xHarbour
Antonio, [quote="Antonio Linares":4gck81zf]Antonio, As far as I know oRs:RecordCount() returns the number of records of the recordset so if you use a WHERE clause then you get less records. Lets ask Mr. Rao[/quote:4gck81zf] Opening same dbf in 2 dif areas One with normal index the RECORDCOUNT = nr of records dbf = ORDKEYCOUNT Second with conditional index SELECT WHERE ... the RECORDCOUNT = nr of records dbf <> ORDKEYCOUNT that is = nr of records within the WHERE clause. Moving through the recordset will soon or later get an error. Please note that the recordset has in fact only the records within the condition although RECORDCOUNT reports all records. This is using serverside cursor.
ADO RDD xHarbour
Antonio, [quote="AHF":1or9letu]What DB you use?[/quote:1or9letu] MDB, MSSQL and MySQL. [quote="AHF":1or9letu]adUseClient would be much easier for adordd (bookmarks etc) but everything I read covering this indicates that adUseClient its much slower and should be avoid.[/quote:1or9letu] adUseClient is faster in my experience. [quote="AHF":1or9letu]Please note that the I'm using SELECT * FROM ... in adordd thats its really not good SQL practice but compatibility much be achieved.[/quote:1or9letu] ??? SELECT * FROM is the base of all SQL queries. What else would you want to use? EMG
ADO RDD xHarbour
[quote="Enrico Maria Giordano":dr97q009][quote="AHF":dr97q009]Please note that the I'm using SELECT * FROM ... in adordd thats its really not good SQL practice but compatibility much be achieved.[/quote:dr97q009] ??? SELECT * FROM is the base of all SQL queries. What else would you want to use? EMG[/quote:dr97q009] I mean avoid loading all the fields instead of just the ones we need for the task.
ADO RDD xHarbour
Antonio [quote="AHF":20bqh5nm]I mean avoid loading all the fields instead of just the ones we need for the task.[/quote:20bqh5nm] Ok, but what if I need all the fields? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
ADO RDD xHarbour
[quote="Enrico Maria Giordano":yp4xe9qn]Antonio [quote="AHF":yp4xe9qn]I mean avoid loading all the fields instead of just the ones we need for the task.[/quote:yp4xe9qn] Ok, but what if I need all the fields? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG[/quote:yp4xe9qn] Then SELECT colname FROM table unfortunatly in adordd its always all the fields! Its the price for no code change.
ADO RDD xHarbour
Antonio, [quote="AHF":2n0penk5]Then SELECT colname FROM table unfortunatly in adordd its always all the fields! Its the price for no code change.[/quote:2n0penk5] Ok, I see, you're right. EMG
ADO RDD xHarbour
Antonio, Can you find rdd function for close all ?
ADO RDD xHarbour
Antonio, UR_FIELDINFO ?
ADO RDD xHarbour
Do you mean DbCloseAll() ? I think you have to implement UR_CLOSE
ADO RDD xHarbour
Antonio, What is this for ? HB_SYMBOL_UNUSED( nWA )
ADO RDD xHarbour
Antonio, [quote="AHF":47e899kj]Antonio, What is this for ? HB_SYMBOL_UNUSED( nWA )[/quote:47e899kj] To avoid unused variable warning. EMG
ADO RDD xHarbour
Enrico, Thanks
ADO RDD xHarbour
Antonio, Ive made some changes to the function FWAdo... because ws returning wrong types and n decimals. These replaced the former functions in adordd ADOGETFIELDSIZE AND DOGETFIELDTYPE. It seems to be correct but Im not sure. Could you or someone check the code below for some bugs? There are also some questions marks to answer if someone knows. [code=fw:1q29talo]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_FIELDSTRUCT<span style="color: #000000;">&#40;</span> oRs, n <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ( oRs, nFld ) where nFld is 1 based</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// ( oRs, oField ) or ( oRs, cFldName )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// ( oField )</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oField, nType, uval<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cType := <span style="color: #ff0000;">'C'</span>, nLen := <span style="color: #000000;">10</span>, nDec := <span style="color: #000000;">0</span>, lRW := .t.,nDBFFieldType := &nbsp;HB_FT_STRING <span style="color: #B900B9;">// default</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nFWAdoMemoSizeThreshold := <span style="color: #000000;">1024</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp; &nbsp;cType DBF TYPE "C","N","D" ETC<br />&nbsp; &nbsp; &nbsp;nDBFFieldType HB_FT_STRING ETC<br />&nbsp; &nbsp;*/</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* IF n == nil<br />&nbsp; &nbsp; &nbsp; oField &nbsp; &nbsp; &nbsp;:= oRs<br />&nbsp; &nbsp; &nbsp; oRs &nbsp; &nbsp; &nbsp; &nbsp; := nil<br />&nbsp; &nbsp;ELSEIF VALTYPE( n ) == 'O'<br />&nbsp; &nbsp; &nbsp; oField &nbsp; &nbsp; &nbsp;:= n<br />&nbsp; &nbsp;ELSE<br />&nbsp; &nbsp; &nbsp; IF ValType( n ) == 'N'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n--<br />&nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; TRY<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oField &nbsp; &nbsp; &nbsp;:= oRs:Fields( n )<br />&nbsp; &nbsp; &nbsp; CATCH<br />&nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp;ENDIF<br />&nbsp; &nbsp;IF oField == nil<br />&nbsp; &nbsp; &nbsp; RETURN nil<br />&nbsp; &nbsp;ENDIF<br />&nbsp; &nbsp;*/</span><br />&nbsp; &nbsp;oField &nbsp; &nbsp; &nbsp;:= oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nType &nbsp; &nbsp; &nbsp; := oField:<span style="color: #000000;">Type</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nType == adBoolean<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'L'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_LOGICAL<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adDate, adDBDate, adDBTime, adDBTimeStamp <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'D'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oRs != <span style="color: #00C800;">nil</span> .AND. ! oRs:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .AND. VALTYPE<span style="color: #000000;">&#40;</span> uVal := oField:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'T'</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//.AND. FW_TIMEPART( uVal ) >= 1.0 WHERE IS THIS FUNCTION?</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cType &nbsp; &nbsp; &nbsp;:= <span style="color: #ff0000;">'@'</span> <span style="color: #B900B9;">//'T'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLen := oField:<span style="color: #000000;">DefinedSize</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nDBFFieldType := HB_FT_TIMESTAMP <span style="color: #B900B9;">// DONT KNWO IF IT IS CORRECT!</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nDBFFieldType := HB_FT_DATE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adTinyInt, adSmallInt, adInteger, adBigInt, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adUnsignedTinyInt, adUnsignedSmallInt, adUnsignedInt, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adUnsignedBigInt <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'N'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := oField:<span style="color: #000000;">Precision</span> + <span style="color: #000000;">1</span> &nbsp;<span style="color: #B900B9;">// added 1 for - symbol</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oField:<span style="color: #000000;">Properties</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ISAUTOINCREMENT"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> == .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cType := <span style="color: #ff0000;">'+'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lRW &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_INTEGER<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adSingle, adDouble, adCurrency <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'N'</span> <span style="color: #B900B9;">//SHOULDNT BE "B"?</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #0000ff;">MIN</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">19</span>, oField:<span style="color: #000000;">Precision</span>-oField:<span style="color: #000000;">NumericScale</span><span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//+ 2 )</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oField:<span style="color: #000000;">NumericScale</span> > <span style="color: #000000;">0</span> .AND. oField:<span style="color: #000000;">NumericScale</span> < nLen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nDec &nbsp;:= oField:<span style="color: #000000;">NumericScale</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_INTEGER <span style="color: #B900B9;">//HB_FT_DOUBLE WICH ONE IS CORRECT?</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adDecimal, adNumeric, adVarNumeric <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'N'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">19</span>, oField:<span style="color: #000000;">Precision</span>-oField:<span style="color: #000000;">NumericScale</span><span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//+ 2 )</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oField:<span style="color: #000000;">NumericScale</span> > <span style="color: #000000;">0</span> .AND. oField:<span style="color: #000000;">NumericScale</span> < nLen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nDec &nbsp;:= oField:<span style="color: #000000;">NumericScale</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_INTEGER <span style="color: #B900B9;">//HB_FT_LONG WICH ONE IS CORRECT?</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adBSTR, adChar, adVarChar, adLongVarChar, adWChar, adVarWChar, adLongVarWChar <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := oField:<span style="color: #000000;">DefinedSize</span><br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> nType != adChar .AND. nType != adWChar .AND. nLen > nFWAdoMemoSizeThreshold<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cType := <span style="color: #ff0000;">'M'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLen &nbsp;:= <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nDBFFieldType := HB_FT_MEMO<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adBinary, adVarBinary, adLongVarBinary <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; cType := <span style="color: #ff0000;">"G"</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := oField:<span style="color: #000000;">DefinedSize</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> nType != adBinary .AND. nLen > nFWAdoMemoSizeThreshold<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cType := <span style="color: #ff0000;">'M'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLen &nbsp;:= <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_OLE<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> nType != adBinary .AND. nLen > nFWAdoMemoSizeThreshold<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nDBFFieldType := HB_FT_MEMO<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adChapter, adPropVariant<span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'O'</span><br />&nbsp; &nbsp; &nbsp; lRW &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_MEMO<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adVariant, adIUnknown <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> <br /><br />&nbsp; &nbsp; &nbsp; cType := <span style="color: #ff0000;">"V"</span><br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_ANY<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adGUID <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adFileTime <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; cType := <span style="color: #ff0000;">"T"</span>&nbsp; <br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_DATETIME<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;ELSEIF ASCAN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adEmpty, adError, adUserDefined, adIDispatch &nbsp;<span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span>&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; cType = <span style="color: #ff0000;">'O'</span><br />&nbsp; &nbsp; &nbsp; lRw := .t.<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_NONE <span style="color: #B900B9;">//what is this? maybe NONE is wrong!</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; lRW &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lAnd<span style="color: #000000;">&#40;</span> oField:<span style="color: #000000;">Attributes</span>, 0x72100 <span style="color: #000000;">&#41;</span> .OR. ! lAnd<span style="color: #000000;">&#40;</span> oField:<span style="color: #000000;">Attributes</span>, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lRW &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> <span style="color: #000000;">&#123;</span> oField:<span style="color: #0000ff;">Name</span>, cType, nLen, nDec, nType, lRW, nDBFFieldType <span style="color: #000000;">&#125;</span><br /><br />&nbsp;</div>[/code:1q29talo]
ADO RDD xHarbour
Antonio, I am afraid that the only way to really test it is once it becomes used by several Harbour/xharbour users
ADO RDD xHarbour
Antonio, What I dont understad is what type of fields we must return to SUPER! Is it only STRING, DATE, LOGICAL, DOUBLE OR INTEGER as in arrayrdd? Im now taking care of :Seek but I need to use DB indexes. Seek cannot be translated to :Find as :Find only works on a single column. Do you code code use index present in the server DB with ADOX? Maybe Enrico has it. Im only missing this to close the first part of adodrdd I hope to post during week end the adordd.
ADO RDD xHarbour
Antonio, Yes, you can only return the types that Harbour supports. What if you issue a new SELECT clause with the WHERE conditions that you are searching for ?
ADO RDD xHarbour
Antonio, [quote="AHF":ua6eh17q]Do you code code use index present in the server DB with ADOX? Maybe Enrico has it.[/quote:ua6eh17q] No, I prefer to use WHERE and ORDER BY clauses. EMG
ADO RDD xHarbour
Antonio, Enrico, I know I shouldnt use ADOX! I agree is the best practice. Indexes are for the DB admin to deliver selects rapidly. But dont forget that what we pretend is to change as little code as possible in our app. I could use seek but then I would have to call a resetseek() to come back to the previous select. Doesnt seems a huge work. But if I need to add blanck recs to the select to come back later for update I would not found them because they still dont fill the select where clause.This is a problem! Maybe using a diferent cursor? Do you have any idea how to workaround this?
ADO RDD xHarbour
Antonio, [quote="AHF":1oh4b7mn]I know I shouldnt use ADOX![/quote:1oh4b7mn] Please note that ADOX is only supported by Microsoft databases. EMG
ADO RDD xHarbour
Enrico, Forgot ADOX going into SELECT.
ADO RDD xHarbour
Use oRs:Filter instead of WHERE, so setting oRs:Filter := "" will make have you have all of them when you need them
ADO RDD xHarbour
Antonio, Filter property has some limitations: [url:194r5bys]https&#58;//msdn&#46;microsoft&#46;com/en-us/library/ee275540(v=bts&#46;10)&#46;aspx[/url:194r5bys] EMG
ADO RDD xHarbour
Antonio, Thanks but it seems filter its not advisable and compatible with all providers. Ill give a try with selects
ADO RDD xHarbour
Antonio, In ADO_OPEN we load all fieldinfo UR_SUPER_ADDFIELD( nWA, aField ). How can we get back after the information save there?
ADO RDD xHarbour
Antonio, Thanks its solved. I need this hb_SToD() What does it do and were can I find it? Can you post the source?
ADO RDD xHarbour
Antonio, [quote="Antonio Linares":3u0iws8o]Antonio, Yes, you can only return the types that Harbour supports.[/quote:3u0iws8o] Are these all the types supported by (x)Harbour? [code=fw:3u0iws8o]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/* FIELD types */</span><br />#ifndef HB_FT_NONE<br /><span style="color: #00D7D7;">#define</span> HB_FT_NONE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_STRING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "C" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_LOGICAL &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">2</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "L" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_DATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">3</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "D" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_LONG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">4</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "N" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_FLOAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">5</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "F" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_INTEGER &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">6</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "I" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_DOUBLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">7</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "B" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_TIME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">8</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "T" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_TIMESTAMP &nbsp; &nbsp; &nbsp; <span style="color: #000000;">9</span> &nbsp; &nbsp; <span style="color: #B900B9;">/* "@" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_MODTIME &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">10</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "=" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_ROWVER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">11</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "^" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_AUTOINC &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">12</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "+" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_CURRENCY &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">13</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "Y" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_CURDOUBLE &nbsp; &nbsp; &nbsp; <span style="color: #000000;">14</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "Z" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_VARLENGTH &nbsp; &nbsp; &nbsp; <span style="color: #000000;">15</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "Q" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_MEMO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">16</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "M" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_ANY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">17</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "V" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_IMAGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">18</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "P" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_BLOB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">19</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "W" */</span><br /><span style="color: #00D7D7;">#define</span> HB_FT_OLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">20</span> &nbsp; &nbsp;<span style="color: #B900B9;">/* "G" */</span><br />#endif<br />&nbsp;</div>[/code:3u0iws8o]
ADO RDD xHarbour
Those types are in Harbour hbusrrdd.ch so I guess yes, not sure if xHarbour is exactly the same
ADO RDD xHarbour
Antonio, Ok Im using those. Cross my fingers! How to use SQL CONVERT to convert expressions like dtos(ddate)+val(ndays) ? Does anyone has a CH file with all defs for CONVERT ?
ADO RDD xHarbour
Antonio,Enrico, Do you know What is the corresponding SQL SELECT ... CONVERT to dtos()?
ADO RDD xHarbour
Antonio, [quote="AHF":1js1vbez]Do you know What is the corresponding SQL SELECT ... CONVERT to dtos()?[/quote:1js1vbez] [code=fw:1js1vbez]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">SELECT</span> * <span style="color: #0000ff;">FROM</span> table <span style="color: #0000ff;">WHERE</span> date = <span style="color: #ff0000;">'20150328'</span></div>[/code:1js1vbez] EMG
ADO RDD xHarbour
Enrico, Thanks but my question was not clear This is to be used in :find expression and I get this error. Args: [ 1] = C DATAFACTUR LIKE '20140407' argumentos { DATAFACTUR LIKE '20140407' } descrição DISP_E_UNKNOWNNAME ficheiro <nenhuma> genCode 41: Unknown or reserved operação FIND osCode (Não é erro do sistema operativo) severity 2 subCode 6 subSystem ADODB.Recordset tries 0 Can :find look for date like that ?
ADO RDD xHarbour
Antonio, [quote="AHF":ei5njxhh]DATAFACTUR LIKE '20140407'[/quote:ei5njxhh] Try with: DATAFACTUR = '20140407' If you are using MDB try this instead: [code=fw:ei5njxhh]<div class="fw" id="{CB}" style="font-family: monospace;">DATAFACTUR = #<span style="color: #000000;">04072014</span>#</div>[/code:ei5njxhh] (DD/MM/YYYY) EMG
ADO RDD xHarbour
Antonio, [url:1bpbxxmd]https&#58;//msdn&#46;microsoft&#46;com/en-us/library/windows/desktop/ms676117%28v=vs&#46;85%29&#46;aspx[/url:1bpbxxmd] It seems that this format is needed: DATAFACTUR = #7/22/97#
ADO RDD xHarbour
Antonio, Enrico, :Find with '20150327' or "20150327" and #20150327# doesnt work always same error. :Find with 27/03/15 works in all above cases. I could make a function [code=fw:2ptvo4bv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">FUNCTION</span> ADODTOS<span style="color: #000000;">&#40;</span>dDate<span style="color: #000000;">&#41;</span><br /><br />&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 /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> DTOC<span style="color: #000000;">&#40;</span>dDate<span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; <span style="color: #00C800;">RETURN</span> DTOS<span style="color: #000000;">&#40;</span>dDate<span style="color: #000000;">&#41;</span><br />&nbsp; <br />&nbsp;</div>[/code:2ptvo4bv] and replace in code dtos with adodtos. But a more clean approach was to redesign the original DTOS to cover this. What is your opinion?
ADO RDD xHarbour
Antonio, In ADO_GETVALUE there is a function hb_stod I dont know why! Should I use stod
ADO RDD xHarbour
Decided different approach. What do you think? [code=fw:2qhifmbg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADODTOS<span style="color: #000000;">&#40;</span>xDate<span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">LOCAL</span> dDate ,cYear,cMonth,cDay<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> <span style="color: #ff0000;">"."</span> IN xDate .OR. <span style="color: #ff0000;">"-"</span> IN xDate .OR. <span style="color: #ff0000;">"/"</span> IN xDate<br />&nbsp; &nbsp; &nbsp; &nbsp;dDate := xDate<br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cYear &nbsp;:= <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>xDate,<span style="color: #000000;">1</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; cMonth := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>xDate,<span style="color: #000000;">5</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; cDay &nbsp; := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>xDate,<span style="color: #000000;">7</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; dDate &nbsp;:= CTOD<span style="color: #000000;">&#40;</span>cDay+<span style="color: #ff0000;">"/"</span>+cMonth+<span style="color: #ff0000;">"/"</span>+cYear<span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> DTOC<span style="color: #000000;">&#40;</span>dDate<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2qhifmbg]
ADO RDD xHarbour
Antonio, If it works then keep going, later on we can always modify it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Different date literal formats work with different SQL databases and also depending on settings. Interestingly American dateformats work with many, because all the software is written by programmers (whatever be their nationality) sitting in USA. But we better stick to international formats. But the following formats always work irrespective of locale, wherever in the world, and irrespective of locale settings: Oracle: WHERE DATEFLD = DATE 'YYYY-MM-DD' MsSql, MySql and many others WHERE DATEFLD = 'YYYY-MM-DD' MSAccess WHERE DATEFLD = #YYYY-MM-DD# For ADO FILTERS, irrespective of the datasource. oRs:Filter = "DATEFLD = #YYYY-MM-DD#" Note: 1) I know may alternative formats which work with different databases. But here I gave those that work for sure and simple to make. 2) FW_DateToADO() and FW_DateToSQL() may be referred to in the adofuncs.prg
ADO RDD xHarbour
FW_ValToSQL( anyvalue ) in adofuncs.prg may also be seen I suggest there is no need to reinvent anything.
ADO RDD xHarbour
Dear Rao, With your help and ADO expertise, AdoRdd can turn into a great tool <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Many thanks for joining this thread
ADO RDD xHarbour
Great help! Thanks Mr. Rao! Can you post those functions here as I dont have them? Im working on Seeks transforming it into :find or SELECT as one or more fields present in the expression. Im stucked in a problem when we use lSoftSeek. Do you have any idea how to emulate that with Sql?
ADO RDD xHarbour
We can implement Seeks and Locates using Ado Find. Limitations are that Find works with only one field. You may examine XBrowse incremental seek for ado for the logic. For seek we may use FLDNAME LIKE <cseek>* (char) FLDNAME = <cseek> (other) Softseek FLDNAME >= <cseek> I hope you are using FWH, you can refer to xbrowse.prg for implementation of seek and adofuncs.prg for the functions I referred to in earlier post
ADO RDD xHarbour
Antonio, I dont have those ado functions can you send the file to me ? You can download adordd from <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Set rdd to adordd Add your index files to ListIndex() accordingly to the specs. All temp name index files must be present in ListTmpNames() "TMP","TEMP" Ready: Open Close Indexes Locks Navigation Find dbinfo ordinfo Seek (without lSoftSeek)
ADO RDD xHarbour
Antonio, Already sent to your email many thanks for sharing it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> you are doing a great work, hopefully it gets completed very soon!
ADO RDD xHarbour
Antonio, IF UPPER(SUBSTR(cOrder,1,3)) IN aTempFiles .OR. UPPER(SUBSTR(cOrder,1,4)) [b:1dskhk9h]IN aTempFiles [/b:1dskhk9h] this only works with xHarbour. I advise you not to code like this, as Harbour users, the majority, won´t be able to try and test it. With your latest additions it only gives the above error. Thank you.
ADO RDD xHarbour
Antonio, Very great news!!. When the code is mature, please tell me to test it with a real application. Thank you very much,
ADO RDD xHarbour
Lucas, Thanks Ill do that. But you can try it already. See adordd.prg and adordd.ch (only locates need to be redefined) You need to fill the index array with your indexes and thats it. Relations, Set scopes are undergoing. You will understand the approach and see how it works for you.
ADO RDD xHarbour
Antonio, Im finishing Set Scopes. What is the normal behaviour? The scope if not cleared it remains with the index athough we change orders? I mean : [code=fw:kbn0esi2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />sele <span style="color: #000000;">0</span><br />use xtable<br />set <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">to</span> index1,index2<br />set order <span style="color: #0000ff;">to</span> index1<br /><br />set scope <span style="color: #0000ff;">to</span> exp1,exp2<br /><br />browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//with scope</span><br /><br />set order <span style="color: #0000ff;">to</span> index2<br /><br />Browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//wihtout scope</span><br /><br />set order <span style="color: #0000ff;">to</span> index1<br /><br />browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// the scope becomes active or not?</span><br /><br />&nbsp;</div>[/code:kbn0esi2] Please resend also the requested functions see my email.
ADO RDD xHarbour
Antonio, I am sorry but I don´t understand what you said about indexes. Can yo please be more specific?. Also, have you modified original adordd.ch?. In my previous tests, this is a sample I tested: [code=fw:3eonanuy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd.prg"</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><br />REQUEST ADORDD<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; <br />&nbsp; USE dolphin_man &nbsp; VIA <span style="color: #ff0000;">"ADORDD"</span> &nbsp; TABLE <span style="color: #ff0000;">"clientes"</span> &nbsp; MYSQL ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"dolphintest.sitasoft.net"</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; USER <span style="color: #ff0000;">"test_dolphin"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PASSWORD <span style="color: #ff0000;">"123456"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"DEMO"</span><br /><br /><br /><br />&nbsp; <span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"DEMO"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; MSGALERT<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; DEMO-><span style="color: #000000;">&#40;</span> &nbsp;dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp; <br />&nbsp; APPEND BLANK<br /><br />&nbsp; REPLACE FIELD->NOME &nbsp; WITH <span style="color: #ff0000;">"LUCAS DE BELTRAN"</span><br />&nbsp; REPLACE FIELD->EMAIL &nbsp;WITH <span style="color: #ff0000;">"NOSPAM@GMAIL.COM"</span><br /><br />&nbsp; DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <br />&nbsp; <span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <br /><br />&nbsp; &nbsp;USE<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3eonanuy]
ADO RDD xHarbour
Lucas, The adordd us being altered in order to keep the same dbf app logic applied to any source data. Saying that the indexes in the adordd are virtual as they dont exist as files! (see adordd ordlstadd, orslstfocus and listindex ) In fact the indexes are selects order by the defined "index order" in the indexes array so that one can continue to use the same exactly the same syntax as before without SQL. If you dont have indexes your tests for you the adordd its like before. See adordd to understand what I mean. My goal its to achieve total 100% dbf syntax with any data source thus using adordd without changing any code. (I know with some performanc degradation but its impossible otherwise) Please comment the following lines in ado_open() and ty it. hb_adoSetEngine( "") hb_adoSetServer( "") hb_adoSetQuery( ) hb_adoSetUser( "") hb_adoSetPassword( "" ) Im using this for my testings only.
ADO RDD xHarbour
Hello, I would like to test with indexes, because that was the only lack in adordd.prg provided within Harbour. I also use ordsetfocus(), i e: [code=fw:trvc9zbc]<div class="fw" id="{CB}" style="font-family: monospace;">CLIENTES-><span style="color: #000000;">&#40;</span> &nbsp;OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"CLIENTES1"</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span></div>[/code:trvc9zbc] Thank you.
ADO RDD xHarbour
Lucas, Go to ListIndex in adordd and add to the index array wahtever you want respecting the aray spec: { {"TABLENAME",{"INDEXNAME","INDEXKEY","WHERE EXPRESSION AS USED FOR FOREXPRESSION","UNIQUE - DISTINCT ANY SQL STAT BEFORE * FROM"} } ex. {{"CLIENTES1",{"PAISCLIENTE","WHERE PAISCLIENTE = ' BRASIL'", "DISTINCT"}} its equal to INDEX PAISCLIENTE FOR PAISCLIENTE = ' BRASIL' UNIQUE If you see that the order its not like before just adjust the index expression for sql in the index array. When you create an index its always considered temporary only exist during the application runtime. In this case adordd checks the temp names in the ListTmpNames. If your temp name doesnt start with any of those you will get after a ors:open error. But if you want you can add your your temp names to that array. Please remember that only its checkeed for the temp names till 4th position in the name. Here you dont need to ave the expressions because ordecreate will supply them to adordd thatsaves them. Thats it <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
ADO RDD xHarbour
Thank you. In your git there is no adordd.ch: [img:nhdyr20d]http&#58;//i60&#46;tinypic&#46;com/2a8qqhg&#46;png[/img:nhdyr20d]
ADO RDD xHarbour
Lucas, Antonio do need feedback so you are very welcome to this thread <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Thanks for testing and helping Antonio!
ADO RDD xHarbour
Yes, it is a very exciting contribution. I am going to test it with a full application, not a simple sample. I just nedd latest adordd.ch, as it is not in Antonio´s guithub. Hope we achieve this goal for the community.
ADO RDD xHarbour
Lucas, Flle is there already. I didnt change adordd.ch file its the original of Harbour.
ADO RDD xHarbour
Antonio, Please see my email I could not receive the prg file.
ADO RDD xHarbour
Very interesting contribution <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
ADO RDD xHarbour
Antonio, ordscope() is calling ordinfo(). The array is with 6 elements but I cant find out what they refer to. The 4th ele seems to be the scope value what are the others (empty) ? Can you help me tracking this?
ADO RDD xHarbour
Antonio, I just resent it to you as a zip file
ADO RDD xHarbour
Antonio, [quote:2y0721cw]The array is with 6 elements but I cant find out what they refer to. The 4th ele seems to be the scope value what are the others (empty) ?[/quote:2y0721cw] Could you copy that source code here ? thanks