Page 61 of 70

Re: ADO RDD xHarbour

PostPosted: Tue Oct 20, 2015 3:29 pm
by AHF
Gunther,

Those are left overs from trials.
Take out ";cpath" you dot need it anymore. The database its auto created if not exist during connection.

In fact if you verify the table was created in the database indicated in SET ADO DEFAULT DATABASE...

Confirm?

Re: ADO RDD xHarbour

PostPosted: Tue Oct 20, 2015 3:43 pm
by byte-one
Antonio, sorry, no tables!
I test
Code: Select all  Expand view
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!!!

Re: ADO RDD xHarbour

PostPosted: Tue Oct 20, 2015 3:53 pm
by AHF
Gunther,

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

Re: ADO RDD xHarbour

PostPosted: Tue Oct 20, 2015 4:00 pm
by byte-one
Antonio, please see my earlier post!
All is ok now!

Thanks for your great work!

Re: ADO RDD xHarbour

PostPosted: Tue Oct 20, 2015 4:45 pm
by byte-one
In tryadordd.prg change

Code: Select all  Expand view
IF !FILE(   "\TESTADORDD.mdb"   )
in
Code: Select all  Expand view
IF !hb_adoRddExistsTable( ,"table1")

Re: ADO RDD xHarbour

PostPosted: Tue Oct 20, 2015 5:04 pm
by AHF
Gunther,

Done.

Thanks

Re: ADO RDD xHarbour

PostPosted: Wed Oct 21, 2015 9:57 pm
by AHF
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

Re: ADO RDD xHarbour

PostPosted: Thu Oct 22, 2015 1:44 pm
by byte-one
Antonio in line 927
Code: Select all  Expand view
nSecs := Seconds()

should be removed!

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

Thanks

Re: ADO RDD xHarbour

PostPosted: Thu Oct 22, 2015 2:24 pm
by AHF
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.

Re: ADO RDD xHarbour

PostPosted: Thu Oct 22, 2015 9:00 pm
by byte-one
Antonio, and for clearness:
In which cases UDF-Indexes are required and can i use in normal indexes (with SORT) all Harbour functions?

Re: ADO RDD xHarbour

PostPosted: Thu Oct 22, 2015 9:19 pm
by AHF
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?

Re: ADO RDD xHarbour

PostPosted: Fri Oct 23, 2015 12:10 pm
by byte-one
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!?

Re: ADO RDD xHarbour

PostPosted: Fri Oct 23, 2015 12:24 pm
by AHF
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?

Re: ADO RDD xHarbour

PostPosted: Fri Oct 23, 2015 12:48 pm
by byte-one
Antonio, where in hb_AdoUpload() (or in other function) are this conversations to do? As parameter Y/N?

Re: ADO RDD xHarbour

PostPosted: Fri Oct 23, 2015 1:14 pm
by AHF
Gunther,

Sorry I misunderstood.

Can you post the error?