ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Mon Jun 15, 2015 2:37 pm

Gunther,

You re absolutely right. Done!

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

Re: ADO RDD xHarbour

Postby AHF » Mon Jun 15, 2015 2: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby byte-one » Tue Jun 16, 2015 9: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: 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 ] ))
 
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: ADO RDD xHarbour

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

Re: ADO RDD xHarbour

Postby AHF » Tue Jun 16, 2015 1: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Wed Jun 17, 2015 8:50 am

New adordd English manual at https://github.com/AHFERREIRA/adordd.git
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby byte-one » Wed Jun 17, 2015 11:31 am

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 ))
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: ADO RDD xHarbour

Postby AHF » Wed Jun 17, 2015 2:43 pm

Gunther,

Done!

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

Re: ADO RDD xHarbour

Postby dutch » 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?
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,
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
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: ADO RDD xHarbour

Postby AHF » Thu Jun 18, 2015 8: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby dutch » Thu Jun 18, 2015 9: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 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
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: ADO RDD xHarbour

Postby lucasdebeltran » Thu Jun 18, 2015 9: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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Thu Jun 18, 2015 9: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Thu Jun 18, 2015 9: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Thu Jun 18, 2015 9: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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 117 guests