FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO RDD xHarbour
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADO RDD xHarbour
Posted: Tue May 26, 2015 03:22 PM

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.

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.
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue May 26, 2015 03:35 PM
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.

Also, I have to say that your ADORDD is much faster than SQLRDD from xHarbour.com and Patrick Mast.


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.
Regards

Antonio H Ferreira
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADO RDD xHarbour
Posted: Tue May 26, 2015 05:09 PM

Antonio,

With the version you send me a coupple of hours ago, filters are failing again.

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.
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue May 26, 2015 05:14 PM

Lucas,

Sorry it was my mistake.

Please see my email.

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue May 26, 2015 05:29 PM

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?

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue May 26, 2015 05:32 PM

Lucas,

Concerning eval error this only happens when you dont have a active filter Right?

Regards

Antonio H Ferreira
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADO RDD xHarbour
Posted: Tue May 26, 2015 05:44 PM

Yes.

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.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: ADO RDD xHarbour
Posted: Wed May 27, 2015 02:43 PM
Antonio,

AHF wrote:How can we catch the connection lost error?

Do you or anyone have any experience with this. Mr Rao? Enrico? Rick?


What about TRY/CATCH/END?

EMG
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Wed May 27, 2015 03:29 PM

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.

Regards

Antonio H Ferreira
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADO RDD xHarbour
Posted: Fri May 29, 2015 10:05 AM
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.
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADO RDD xHarbour
Posted: Tue Jun 02, 2015 07:14 AM
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. :cFilterFld := "FIRST" you have to indicate the field you want to filter for.


Code (fw): Select all Collapse
//-----------------------------------------------------------------------------
function testWildSeek( cAlias )
//-----------------------------------------------------------------------------

   local oDlg, oBrw, oCbx, oFont, nWild := 2
   local nOpt        := 1




   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

   DEFINE DIALOG oDlg SIZE 900,400 PIXEL ;
      TITLE "Test WildSeek v. 3 "+FWVERSION ;
      FONT oFont

   @ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      DATASOURCE cAlias AUTOCOLS AUTOSORT ;
      CELL LINES NOBORDER



   WITH OBJECT oBrw

      :nMarqueeStyle := 4
      :lIncrFilter   := .t.
      :lSeekWild     := .t. 
      :cFilterFld    := "FIRST"
      :nStretchCol   := STRETCHCOL_WIDEST

      :CreateFromCode()
   END


/*
   @ 10,10 COMBOBOX nOpt PROMPTS { "Starting With", "Containing" } ;
      SIZE 60,44 PIXEL OF oDlg  ;
      ON CHANGE ( oBrw:lSeekWild := ( nOpt == 2 ), ;
                  oBrw:Seek( If( oBrw:lSeekWild, oBrw:cSeek, "" ) ),;
                  oBrw:Refresh(), oBrw:SetFocus() )
*/


   @ 10, 80 SAY oBrw:oSeek PROMPT oBrw:cSeek SIZE 120,10 PIXEL OF oDlg ;
      COLOR CLR_RED,CLR_YELLOW

   @ 10, 210 BUTTON  "Clean xBrowse WildSeek" ACTION ( oBrw:Seek( "" ), oBrw:Setfocus() )    PIXEL

   @ 10, 350 BUTTON  "DbClearFilter()" ACTION ( msgalert( dbfilter(), "ACTIVE FILTER" ), dbclearfilter(), oBrw:Setfocus() )    PIXEL


   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oBrw:SetFocus(), .f. )

   RELEASE FONT oFont


Return nil

//----------------------------------------------------------------------------//



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.
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Fri Jun 12, 2015 09:02 AM

Stay tuned adordd its ready and Ill post new version later today.

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Fri Jun 12, 2015 07:42 PM
Adordd its ready to work at https://github.com/AHFERREIRA/adordd.git

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): Select all Collapse
Delete record recno
BlankRec()  //this will not work either comment it or place it before delete.

delete all  //this will not work take it from here
while....
 if lcondition  //change condition to not
   recall record  //delete each record here
 endif
end


Thats it!

But you can do much more:
Code (fw): Select all Collapse
hb_GetAdoConnection():Execute("CREATE VIEW cView ....")

sele 0
use cView

Browse()


True locks as any other rdd.
Upload tables to any Sql server just like:

Code (fw): Select all Collapse
use table VIA "DBFCDX"
copy to sqltable via "ADORDD"


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.
Regards

Antonio H Ferreira
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Mon Jun 15, 2015 11:58 AM
Antonio, at this place on line 5348 the rdd should not be hardcoded!

Code (fw): Select all Collapse
 IF !FILE(cTable)
聽 聽 聽DBCREATE(cTable,;
聽 聽 聽{ {"CODLOCK","C",50,0 }},;
聽 聽 聽"DBFCDX",.T.,"TLOCKS")
聽 聽 聽INDEX ON CODLOCK TO (cIndex)
聽 ENDIF

should be
Code (fw): Select all Collapse
 IF !FILE(cTable)
聽 聽 聽DBCREATE(cTable,;
聽 聽 聽{ {"CODLOCK","C",50,0 }},;
聽 聽 聽rRdd,.T.,"TLOCKS")
聽 聽 聽INDEX ON CODLOCK TO (cIndex)
聽 ENDIF
Regards,
G眉nther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Mon Jun 15, 2015 02:37 PM

Gunther,

You re absolutely right. Done!

Thanks.

Regards

Antonio H Ferreira