FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO RDD xHarbour
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Tue Nov 03, 2015 09: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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: 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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Tue Nov 03, 2015 01: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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue Nov 03, 2015 01: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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Tue Nov 03, 2015 06:40 PM

OK now []! Thanks.

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: 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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: 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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Thu Nov 05, 2015 11:48 AM
After
Code (fw): Select all Collapse
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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Thu Nov 05, 2015 12:11 PM
Gunther,

Here its ok.
My test:

Code (fw): Select all Collapse
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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: 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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Thu Nov 05, 2015 01: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 (fw): Select all Collapse
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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Thu Nov 05, 2015 02:46 PM
Gunther,

Is this still true if you comment
Code (fw): Select all Collapse
TESTADISC->(dbgoto(TESTADISC->(lastrec()+1)))    //damit keine anzeige
?
Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Thu Nov 05, 2015 02:57 PM
Gunther,

I think Ive got it.

Change the line in ado_seek.

Code (fw): Select all Collapse
  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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Thu Nov 05, 2015 03:08 PM

Antonio, no working! This is only for softseek!?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Thu Nov 05, 2015 03:25 PM

Gunther,

Right nevertheless that was a bug!

Is it still occur if you comment TESTADISC->(dbgoto(TESTADISC->(lastrec()+1))) //damit keine anzeige ?

Regards

Antonio H Ferreira