ADO RDD xHarbour

AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Gunther,

You re absolutely right. Done!

Thanks.
Regards
Antonio H Ferreira
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

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: Select all

          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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

New adordd English manual at https://github.com/AHFERREIRA/adordd.git
Regards
Antonio H Ferreira
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

Antonio in line 405 the code must be anstead:

Code: Select all

              CASE aWAData[ WA_ENGINE ] == "SQL"

Code: Select all

               CASE aWAData[ WA_ENGINE ] == "MSSQL"
And in line 5203 also the block of code MUST so:

Code: Select all

       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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Gunther,

Done!

Thanks.
Regards
Antonio H Ferreira
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: ADO RDD xHarbour

Post by dutch »

I try to open table in localhost (MySql), the result is below.
It took time to open 335,819 records. Is it normal?
Image

Code: Select all

.....
    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 19.01 / 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)
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: ADO RDD xHarbour

Post by dutch »

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 19.01 / 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)
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: ADO RDD xHarbour

Post by lucasdebeltran »

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.
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: ADO RDD xHarbour

Post by lucasdebeltran »

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.
Post Reply