Page 48 of 70

Re: ADO RDD xHarbour

PostPosted: Mon Jun 15, 2015 2:37 pm
by AHF
Gunther,

You re absolutely right. Done!

Thanks.

Re: ADO RDD xHarbour

PostPosted: Mon Jun 15, 2015 2:42 pm
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.

Re: ADO RDD xHarbour

PostPosted: Tue Jun 16, 2015 9:49 am
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  Expand view
          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 ] ))
 

Re: ADO RDD xHarbour

PostPosted: Tue Jun 16, 2015 11:45 am
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!

Re: ADO RDD xHarbour

PostPosted: Tue Jun 16, 2015 1:04 pm
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.

Re: ADO RDD xHarbour

PostPosted: Wed Jun 17, 2015 8:50 am
by AHF
New adordd English manual at https://github.com/AHFERREIRA/adordd.git

Re: ADO RDD xHarbour

PostPosted: Wed Jun 17, 2015 11:31 am
by byte-one
Antonio in line 405 the code must be anstead:
Code: Select all  Expand view
             CASE aWAData[ WA_ENGINE ] == "SQL"

Code: Select all  Expand view
              CASE aWAData[ WA_ENGINE ] == "MSSQL"


And in line 5203 also the block of code MUST so:
Code: Select all  Expand view
      CASE  cEngine == "MSSQL"
              oCn:Open( "Provider=SQLOLEDB;" + ;
                        "server=" + cServer + ;
                        ";database=" + cDB  + ;
                          iif(empty(cUser),";Trusted_Connection=yes",;
                        ";uid=" + cUser + ;
                        ";pwd=" + cPass ))

Re: ADO RDD xHarbour

PostPosted: Wed Jun 17, 2015 2:43 pm
by AHF
Gunther,

Done!

Thanks.

Re: ADO RDD xHarbour

PostPosted: Wed Jun 17, 2015 10:22 pm
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  Expand view
.....
    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,

Re: ADO RDD xHarbour

PostPosted: Thu Jun 18, 2015 8:46 am
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?

Re: ADO RDD xHarbour

PostPosted: Thu Jun 18, 2015 9:12 am
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.

Re: ADO RDD xHarbour

PostPosted: Thu Jun 18, 2015 9:23 am
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.

Re: ADO RDD xHarbour

PostPosted: Thu Jun 18, 2015 9:28 am
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.

Re: ADO RDD xHarbour

PostPosted: Thu Jun 18, 2015 9:29 am
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?

Re: ADO RDD xHarbour

PostPosted: Thu Jun 18, 2015 9:30 am
by lucasdebeltran
30.000 records so far.