FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO RDD xHarbour
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Mon Jun 15, 2015 02:42 PM

Dear all,

Please apologize the misaligned code of aodrdd.prg but I only realize it now with Lucas.

Im using NotePad++ and although code is perfectly aligned there it seems thats not the case with MED that most of you are using.

As soon as I can I will passed it through MED to get it all aligned and Ill posted.

Regards

Antonio H Ferreira
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Tue Jun 16, 2015 09:49 AM
Antonio, for MSSQL should on line ~464 the [WA_ENGINE] "MSSQL" to be and not "SQL"!! And if the authentification to the DB without a password but with windows-authentification the text "Trusted_Connection=yes" should be used.

Code (fw): Select all Collapse
          CASE aWAData[ WA_ENGINE ] == "MSSQL"

             aWAData[ WA_CONNECTION ]:Open( "Provider=SQLOLEDB;" + ;
                "server=" + aWAData[ WA_SERVER ] + ;
                ";database=" + t_cDataSource  + ;
                iif(empty(aWAData[ WA_USERNAME ]),";Trusted_Connection=yes",;
                ";uid=" + aWAData[ WA_USERNAME ] + ;
                ";pwd=" + aWAData[ WA_PASSWORD ] ))
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue Jun 16, 2015 11:45 AM
Antonio, for MSSQL should on line ~464 the [WA_ENGINE] "MSSQL" to be and not "SQL"!! And if the authentification to the DB without a password but with windows-authentification the text "Trusted_Connection=yes" should be used.


Done!
Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue Jun 16, 2015 01:04 PM

New adordd version at https://github.com/AHFERREIRA/adordd.git

The code is aligned and clean.

Please read carefully readme to set your app to use adordd.

And please dont forget donate to the humanitarian organization 20 Euros.

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Wed Jun 17, 2015 08:50 AM

New adordd English manual at https://github.com/AHFERREIRA/adordd.git

Regards

Antonio H Ferreira
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Wed Jun 17, 2015 11:31 AM
Antonio in line 405 the code must be anstead:
Code (fw): Select all Collapse
              CASE aWAData[ WA_ENGINE ] == "SQL"

Code (fw): Select all Collapse
               CASE aWAData[ WA_ENGINE ] == "MSSQL"


And in line 5203 also the block of code MUST so:
Code (fw): Select all Collapse
       CASE  cEngine == "MSSQL"
              oCn:Open( "Provider=SQLOLEDB;" + ;
                        "server=" + cServer + ;
                        ";database=" + cDB  + ;
                          iif(empty(cUser),";Trusted_Connection=yes",;
                        ";uid=" + cUser + ;
                        ";pwd=" + cPass ))
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Wed Jun 17, 2015 02:43 PM

Gunther,

Done!

Thanks.

Regards

Antonio H Ferreira
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: ADO RDD xHarbour
Posted: Wed Jun 17, 2015 10:22 PM
I try to open table in localhost (MySql), the result is below.
It took time to open 335,819 records. Is it normal?

Code (fw): Select all Collapse
.....
    SET ADODBF TABLES INDEX LIST TO { {"CCRTBL",{"CCRTBL1","TBL_RMNO"},;
                                                  {"CCRTBL2","UPPER(TBL_LAST)"}}, ;
                                                  {"CCRGST",{"CCRGST1","GST_INTNO"}} ;
                                              }

    SET ADO TABLES INDEX LIST TO      { {"CCRTBL",{"CCRTBL1","TBL_RMNO"}, ;
                                                  {"CCRTBL2","TBL_LAST"}}, ;
                                                  {"CCRGST",{"CCRGST1","GST_INTNO"}} ;
                                              }
    cSTime := time()
    USE ccrgst ALIAS 'gst' NEW SHARED
    cETime := time()
    MsgInfo('Open Time : '+cSTime+' - '+cETime+' Reccount() : '+Str(gst->(Reccount())) )


Thanks,
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Thu Jun 18, 2015 08:46 AM

Dutch,

I would say thats normal.

The problem is when we use a table we read all records to ADO if we are using adUseClient as :CursorLocation.
With the index the time is doubled because ADORDD first issues a query SELECT * FROM... and then when you SE INDEX it issues another SELECT * FROM ORDER BY.
So 2 queries that read all records.

In these cases either you can set the query SELECT * FROM WHERE condition only to read the records you need might be only a few hundred but this will break code compatibility.
Other alternative try to use adUseServer together with CacheSize and the property Maximum Opens Rows.
CacheSize := 100
Maximum Opens Rows := 170

You will need to change the setup of MySql ODBC driver to enable dynamic cursors.

I dont know how ADORDD will behave because it might loose the :AbsolutePositon property but you can try it.

We will have to study this alternative in a next version.

May be Rao could help us with his knowledge of SQL ad ADO.

Besides that is it working ok?

Regards

Antonio H Ferreira
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: ADO RDD xHarbour
Posted: Thu Jun 18, 2015 09:12 AM

1) Function and Command to open/read/write, relation, dbsetfilter(), ordsetfocus(), dbseek() is working well.
2) open record with relation is quite slow. I think the point is JOIN table is the key. Because 'CCRGST' table (guest details) no need to open all records but only the records which related with main table 'CCRTBL' (reservation details).
Is it correct?
How do I join 2 table with ADORDD?

Thanks.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADO RDD xHarbour
Posted: Thu Jun 18, 2015 09:23 AM

Hello,

Set relation works the same way as in DBFCDX.

Try at adordd.prg to comment out all cache settings. I am using ADORDD in a WAN scenario via Internet and speed is very good.

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: Thu Jun 18, 2015 09:28 AM
Dutch,

2) open record with relation is quite slow. I think the point is JOIN table is the key. Because 'CCRGST' table (guest details) no need to open all records but only the records which related with main table 'CCRTBL' (reservation details).
Is it correct?


What do you mean open record ?

How do I join 2 table with ADORDD?


hb_GetAdoConnection():Execute(" CREATE VIEW CVIEWNAME....")
SELE 0
USE CVIEWNAME

If after you dont DROP VIEW (deleted ) next time you will not need to create it.
If you do you lll get a error but program will continue (I think)
You can use it like any other table.
Views are dynamic so always updated with last information.
Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Thu Jun 18, 2015 09:29 AM
Lucas,

lucasdebeltran wrote:Hello,

Set relation works the same way as in DBFCDX.

Try at adordd.prg to comment out all cache settings. I am using ADORDD in a WAN scenario via Internet and speed is very good.


How many records the biggest table?
Regards

Antonio H Ferreira
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADO RDD xHarbour
Posted: Thu Jun 18, 2015 09:30 AM

30.000 records so far.

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: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: ADO RDD xHarbour
Posted: Thu Jun 18, 2015 09:31 AM
Dear Antonio,

Thank you for your help.
AHF wrote:
What do you mean open record ?

I mean open table with all records.
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)