Page 13 of 70

Re: ADO RDD xHarbour

PostPosted: Sun Mar 29, 2015 8:31 am
by nageswaragunupudi
FW_ValToSQL( anyvalue ) in adofuncs.prg
may also be seen

I suggest there is no need to reinvent anything.

Re: ADO RDD xHarbour

PostPosted: Sun Mar 29, 2015 8:45 am
by Antonio Linares
Dear Rao,

With your help and ADO expertise, AdoRdd can turn into a great tool :-)

Many thanks for joining this thread

Re: ADO RDD xHarbour

PostPosted: Sun Mar 29, 2015 9:37 am
by AHF
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?

Re: ADO RDD xHarbour

PostPosted: Sun Mar 29, 2015 10:11 am
by nageswaragunupudi
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

Re: ADO RDD xHarbour

PostPosted: Sun Mar 29, 2015 11:00 am
by AHF
Antonio,

I dont have those ado functions can you send the file to me ?

You can download adordd from https://github.com/AHFERREIRA/adordd.git

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)

Re: ADO RDD xHarbour

PostPosted: Sun Mar 29, 2015 12:10 pm
by Antonio Linares
Antonio,

Already sent to your email

many thanks for sharing it :-)

you are doing a great work, hopefully it gets completed very soon!

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 7:30 am
by lucasdebeltran
Antonio,

Very great news!!.

When the code is mature, please tell me to test it with a real application.

Thank you very much,

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 10:01 am
by AHF
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.

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 10:07 am
by AHF
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: Select all  Expand view

sele 0
use xtable
set index to index1,index2
set order to index1

set scope to exp1,exp2

browse()  //with scope

set order to index2

Browse() //wihtout scope

set order to index1

browse() // the scope becomes active or not?

 


Please resend also the requested functions see my email.

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 10:15 am
by lucasdebeltran
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: Select all  Expand view
#include "adordd.ch"
#include "adordd.prg"

#include "FiveWin.ch"


REQUEST ADORDD

function Main()


 
  USE dolphin_man   VIA "ADORDD"   TABLE "clientes"   MYSQL ;
                    FROM "dolphintest.sitasoft.net"  ;
                    USER "test_dolphin"              ;
                    PASSWORD "123456"                ;
                    ALIAS "DEMO"



  SELECT("DEMO")

  MSGALERT(ALIAS(), RECNO())

  DEMO->(  dbgotop()  )

  xbrowse()



 
  APPEND BLANK

  REPLACE FIELD->NOME   WITH "LUCAS DE BELTRAN"
  REPLACE FIELD->EMAIL  WITH "NOSPAM@GMAIL.COM"

  DBGOTOP()
 
  xBrowse()
 

   USE

return nil

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 10:56 am
by AHF
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.

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 11:24 am
by lucasdebeltran
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: Select all  Expand view
CLIENTES->(  OrdSetFocus("CLIENTES1")  )


Thank you.

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 11:50 am
by AHF
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 :D

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 12:01 pm
by lucasdebeltran
Thank you.

In your git there is no adordd.ch:

Image

Re: ADO RDD xHarbour

PostPosted: Mon Mar 30, 2015 12:38 pm
by Antonio Linares
Lucas,

Antonio do need feedback so you are very welcome to this thread :-)

Thanks for testing and helping Antonio!