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 Oct 20, 2015 03:43 PM
Antonio, sorry, no tables!
I test
Code (fw): Select all Collapse
DbCreate( "table2;test2.mdb", ....
DbCreate( "table2;test2", ....
DbCreate( "table2;\test2.mdb", ....


Antonio, i found MY bug! I check with file() the .MdB and as she is produced on connection i never come to the dbcreate()...

THANKS, ALL IS OK!!!
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue Oct 20, 2015 03:53 PM

Gunther,

Do it just like in clipper DbCreate( "table2,{...)
Is SET ADO DEFAULT DATABASE TO TESTADORDD.MDB ? Isnt the table there instead ?

Regards

Antonio H Ferreira
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Tue Oct 20, 2015 04:00 PM

Antonio, please see my earlier post!
All is ok now!

Thanks for your great work!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Tue Oct 20, 2015 04:45 PM
In tryadordd.prg change

Code (fw): Select all Collapse
IF !FILE(   "\TESTADORDD.mdb"   )
in
Code (fw): Select all Collapse
IF !hb_adoRddExistsTable( ,"table1")
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Tue Oct 20, 2015 05:04 PM

Gunther,

Done.

Thanks

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Wed Oct 21, 2015 09:57 PM

New build adordd ver 1.0 at https://github.com/AHFERREIRA/adordd.git

minor bugs corrections
better detection of refreshing new records added by others
improvement speed in replaces

Regards

Antonio H Ferreira
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Thu Oct 22, 2015 01:44 PM
Antonio in line 927
Code (fw): Select all Collapse
nSecs := Seconds()

should be removed!

An other technical question:
In which moment the indexes are build??

Thanks
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Thu Oct 22, 2015 02:24 PM

Gunther,

Left overs! Done!

Indexes without UDFs are not really created they are transform into ado_sort.
This is done when calling set order to, ordsetfocus just like in clipper resuming when the order becomes active.

Indexes with UDFs are created either with index on... or created with ordsetfocus if the index is in SET ADODBF INDEX...
These indexes are really an array of bookmarks ordered by eval key expression thats why they should be avoided as much as possible.
These arrays of bookmarks are auto maintained by adordd and as key expression is altered or added the same way as clipper.

Resuming:
Indexes without UDFs are extremely fast to build as :sort its extremely fast. Here tests with MySql tables > 800.000 recs its immediate.

Indexes with UDFS without a while clause or not with a SCOPE are much slower as all records must be read, added to the array and sort after the array. This only happens once during the application life time.
However its not too slow its still workable.

Indexes with UDFS with a while clause depends of the size of the range.

I hope Ive made it clear.

Regards

Antonio H Ferreira
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Thu Oct 22, 2015 09:00 PM

Antonio, and for clearness:
In which cases UDF-Indexes are required and can i use in normal indexes (with SORT) all Harbour functions?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Thu Oct 22, 2015 09:19 PM

Gunther,

In Harbour indexes we have 2 kind of functions.

1st the ones we are obliged to use because we must have only one data type in the index expression. The big part!
These are conversion data type functions that is not needed in ADO :sort thus adordd extracts the fields and is straight forward. You dont need to worry about these and do not need to be included in SET UDFS. ( EX. DTOS, DTOC, STR, VAL, ETC)

2nd the ones that alter the index expression value for ex SUBSTR or IF( fieldvalue, "1", "2" ) var evaluation & true User Defined Functions.
These we have to declare as UDFS because they need to be evaluated by Harbour and they can not be evaluated by Sort .

Is it clear for you?

Regards

Antonio H Ferreira
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Fri Oct 23, 2015 12:10 PM

Antonio, now is clear! Thanks.

Now i have converted with your function some DBFs to MSSQL. All is ok, but if in a character- or Memofield is a single Quote, a error occurs! This quotes should be converted in another character!?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Fri Oct 23, 2015 12:24 PM

Gunther,

I decided not to translate these strings at adordd because then problems come with passwords, encrypted strings etc. Thus the user has to decide himself how he pretends to save it.
If anyone has a better idea we can try to include it in adordd.

You can try

STRTRAN( cStr, "'" , "''" )

or

STRTRAN( cStr, "'","\'") //Im not sure about the escape char

Did it work?

Regards

Antonio H Ferreira
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Fri Oct 23, 2015 12:48 PM

Antonio, where in hb_AdoUpload() (or in other function) are this conversations to do? As parameter Y/N?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Fri Oct 23, 2015 01:14 PM

Gunther,

Sorry I misunderstood.

Can you post the error?

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Fri Oct 23, 2015 02:27 PM

Gunther,

I see it now.
The app I m using does not accept single quotes in fields because of some xml extraction.

Try with this in ado_putvalue

xValue := '"'+xValue+'"'

Instead of xValue := "'"+xValue+"'"

Regards

Antonio H Ferreira