ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Mon Nov 02, 2015 7:30 pm

Gunther,

Great! Im glad to know :D

A practice suggestion:
In ADOPREOPENTHRESHOLD() not only the size in records should work as a filter. Also a substring (or a array with substrings) of the tablename are interesting for filtering the DBs for pre-open! (ex. only "2015" -> DB2015 and Faw2015gt and Klima2015 and ......)


Note taken Ill see what can be done.

Could you share your experience ?

Time of conversion of the app
Any app code changed ? Why?

Db engine used
Database size
Average table size (nr of rows)
Biggest table size (nr of rows)
Lan and / or Wan
Nr of users
Concurrent use (new additions by others) and locking

Does app use ?
Relations
Scopes
Filters
Indexes with UDFs
Locks
Transactions

do you use ado or sql directly through for example adofuncs.prg or any class and does adordd catch well eventually new additions by those processes?

Overall performance compared to others rdds 1 to 5 (1 being the slowest)

Is it in production?

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

Re: ADO RDD xHarbour

Postby byte-one » Tue Nov 03, 2015 9:25 am

Antonio, before i test my app with ca. 60 DBs with your ADORDD i must change some field-names (ex. CHECK or SCHEMA) as they are not allowed in SQL.
I use MSSQL. In my tests indices with UDFs should be avoided (>1000 records). The fastest way is to use only full fieldnames for indexkey. There are some DB-changes recommendable.
For future i will report you all my experiences!
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 Nov 03, 2015 11:03 am

Gunther,

The tests Ive made with Mysql and reserved keywords as field name its working ok.

You cant use those keywords in triggers, procedures functions etc but should be ok as field names as they are special quoted in all expressions.

Please try it because I think you dont need to do anything.

I use MSSQL. In my tests indices with UDFs should be avoided (>1000 records)


I tried it in Mysql with 1000 and its slower but still ok.

Can you post some examples of such UDFs?

For future i will report you all my experiences!


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

Re: ADO RDD xHarbour

Postby byte-one » Tue Nov 03, 2015 1:25 pm

MSSQL-Server native errors 102 or 156: Incorrect syntax near the keyword 'BIT', Incorrect syntax near the keyword 'SCHEMA'. I use SCHEMA and CHECK as fieldnames -> not allowed!
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 Nov 03, 2015 1:38 pm

Gunther,

I forgot to have it done to MSSQL.

Place this line in ADOQUOTEDCOLSQL in CASE dbEngine = "MSSQL"

cCol := "`" + cCol + "`"

if it doesnt work try

cCol := '[' + cCol + ']'

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

Re: ADO RDD xHarbour

Postby byte-one » Tue Nov 03, 2015 6:40 pm

OK now []! Thanks.
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 byte-one » Thu Nov 05, 2015 10:23 am

Antonio, I found, that when the eof() reached no further operations in this table are possible! I must use GO TOP in this case and then the table is reachable again!
(MSSQL)
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 » Thu Nov 05, 2015 11:05 am

Gunther,

Im not using MSSQL Im using MySql and its ok.

Can you post code example ?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby byte-one » Thu Nov 05, 2015 11:48 am

After
Code: Select all  Expand view  RUN
dbgoto(lastrec()+1))
is no dbseek() possible (records to found are present)! Or after a dbseek() with no result another dbseek() are not possible.
If the searched value is not found, DbSeek() positions the record pointer on the "ghost record" (Lastrec()+1) by default, and the function Found() returns .F. (false), while Eof() returns .T. (true).

I think this "ghost record" is the reason!?
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 » Thu Nov 05, 2015 12:11 pm

Gunther,

Here its ok.
My test:

Code: Select all  Expand view  RUN

use table
set index to someindex
dbgoto(lastrec()+1) //record not found goes eof
seek "      1/99" //if recordset not empty goes first and find OK
browse()  
dbgobottom()
skip 1
msginfo(cvaltochar(eof())+" "+cvaltochar(recno()) )
skip -1
msginfo(cvaltochar(eof())+" "+cvaltochar(recno()) )
skip -1
msginfo(cvaltochar(eof())+" "+cvaltochar(recno()) )
 


Do you have any scopes and/or filters?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Thu Nov 05, 2015 12:52 pm

Gunther,

The SELECT used in adoreccount if im not mistaken supplied by you its the only difference between MySql and MsSQL.

Try to change ti to SELECT MAX(... and check results.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby byte-one » Thu Nov 05, 2015 1:10 pm

Now i found out:
If i use TESTADISC->(dbsetorder(1)) and the indexkey of this order is UDF then the seek is not functioning! If i use after dbsetorder() a GO TOP then is functioning!

Code: Select all  Expand view  RUN
SET ADODBF TABLES INDEX LIST TO { {"AW2015",{"REV",'REV2TO2(REDATUM)'},{"RR","bu_korrindex(redatum,ideingdat)"},{"EW",'REV2TO2(REDATUM)'} } }
SET ADO INDEX UDFS TO {"IF","&","SUBSTR","SUBS","==","REV2TO2","REVEING","BU_KORRINDEX"}

TESTADISC->(dbgoto(TESTADISC->(lastrec()+1)))    //damit keine anzeige
TESTADISC->(dbsetorder(1))
//  GO TOP
TESTADISC->(dbseek("0227"))
 Browse()
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 » Thu Nov 05, 2015 2:46 pm

Gunther,

Is this still true if you comment
Code: Select all  Expand view  RUN
TESTADISC->(dbgoto(TESTADISC->(lastrec()+1)))    //damit keine anzeige
?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Thu Nov 05, 2015 2:57 pm

Gunther,

I think Ive got it.

Change the line in ado_seek.

Code: Select all  Expand view  RUN

  ELSE //WITH :FILTER OR MOE THAN ONE FIELD
      IF !EMPTY( oRecordSet:Filter )
         IF lSoftSeek
            nPos := ASCAN( aWAData[ WA_ABOOKMARKS ][aWAData[WA_INDEXACTIVE]],;
                     {|x|  IF( VALTYPE( x[ 2 ] )= "C",SUBSTR( x[ 2 ], 1, LEN( cKey ) ) = cKey ,;
                                x[ 2 ] = cKey   )} )

            IF nPos = 0 // oRs:Eof() //!lFindLast     <========
 


Is it working ?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby byte-one » Thu Nov 05, 2015 3:08 pm

Antonio, no working! This is only for softseek!?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 80 guests