ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby nageswaragunupudi » Sun Mar 29, 2015 8:31 am

FW_ValToSQL( anyvalue ) in adofuncs.prg
may also be seen

I suggest there is no need to reinvent anything.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ADO RDD xHarbour

Postby Antonio Linares » Sun Mar 29, 2015 8:45 am

Dear Rao,

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

Many thanks for joining this thread
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Sun Mar 29, 2015 9:37 am

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?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby nageswaragunupudi » Sun Mar 29, 2015 10:11 am

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ADO RDD xHarbour

Postby AHF » Sun Mar 29, 2015 11:00 am

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)
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Sun Mar 29, 2015 12:10 pm

Antonio,

Already sent to your email

many thanks for sharing it :-)

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby lucasdebeltran » Mon Mar 30, 2015 7:30 am

Antonio,

Very great news!!.

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

Thank you very much,
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 30, 2015 10:01 am

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.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 30, 2015 10:07 am

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.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Mon Mar 30, 2015 10:15 am

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
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 30, 2015 10:56 am

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.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Mon Mar 30, 2015 11:24 am

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.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 30, 2015 11:50 am

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
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Mon Mar 30, 2015 12:01 pm

Thank you.

In your git there is no adordd.ch:

Image
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby Antonio Linares » Mon Mar 30, 2015 12:38 pm

Lucas,

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

Thanks for testing and helping Antonio!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests