topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
ADO RDD xHarbour
|
Antonio,
About Append from, please review function fw_dbftoado().
About refreshing, yes it is a behaviour in ADO, but xBrowse does refresh when scrolling. Also, I do refresh Recordset after adding of editing records, so in my opinion it´s not an issue.
Thank you
|
ADO RDD xHarbour
|
[quote:34yfbjmm]About Append from, please review function fw_dbftoado().[/quote:34yfbjmm]
Where can I find it?
[quote:34yfbjmm]About refreshing, yes it is a behaviour in ADO, but xBrowse does refresh when scrolling. Also, I do refresh Recordset after adding of editing records, so in my opinion it´s not an issue.[/quote:34yfbjmm]
What you mean by refreshing is it requery ?
Thus if other user add new record you will only see it after adding or editing?
|
ADO RDD xHarbour
|
Antonio,
At source\adofuncs.prg
function FW_AdoImportFromDBF( oCn, cDbf, cAdoTable, cColPrefix, nMultiRowSize, aFields )
function FW_AdoExportToDBF( oRs, cDbf, lEditStruct )
In xBrowse yes. But that´s not a problem, in DBFCDX you have to issue a refresh() too.
xBrowse handles it very good with ADORDD. You should try latest xbrowse.
|
ADO RDD xHarbour
|
Lucas,
In the app we are working browses are not a problem. All work well without a single changed line.
My worry is with transactions.
The app works 99% like this:
First closes and add all records to all tables necessary to the trans.
If all goes well loop through those records in the several tables and replace values
Lets say a another user add a line to an order before its locked.
When I initiate transaction locking the order that new record does not exist in my set yet.
Thus will not be taken in account in my transaction.
Dont you think this is a potential problem?
By the way I have xbrowse code here and I cant see any :Requery
|
ADO RDD xHarbour
|
Antonio, with this new version the errors are gone except the following:
I compile with xHarbour!
[code=fw:3f1bm3py]<div class="fw" id="{CB}" style="font-family: monospace;">MAKE Version <span style="color: #000000;">5.2</span> Copyright <span style="color: #000000;">(</span>c<span style="color: #000000;">)</span> <span style="color: #000000;">1987</span>, <span style="color: #000000;">2000</span> Borland<br /> c:\xharbour\bin\harbour.exe -i.;c:\fwh\include;c:\prg_allgemein;c:\termi<br />ne;c:\xharbour\include -n -m -w -es2 -gc3 -dtestfassung -d__GUN__ C:\adordd\ado<br />rdd.prg -o.\adordd.hrb<br />xHarbour <span style="color: #000000;">1.2</span><span style="color: #000000;">.3</span> Intl. <span style="color: #000000;">(</span>SimpLex<span style="color: #000000;">)</span> <span style="color: #000000;">(</span>Build <span style="color: #000000;">20140725</span><span style="color: #000000;">)</span><br />Copyright <span style="color: #000000;">1999</span><span style="color: #000000;">-2014</span>, http:<span style="color: #B900B9;">//www.xharbour.org <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m --></span><br />Compiling <span style="color: #ff0000;">'C:<span style="color: #000000;">\a</span>dordd<span style="color: #000000;">\a</span>dordd.prg'</span>...<br />C:\adordd\adordd.prg<span style="color: #000000;">(</span><span style="color: #000000;">366</span><span style="color: #000000;">)</span> Error E0022 Invalid lvalue: <span style="color: #ff0000;">':'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">(</span><span style="color: #000000;">1633</span><span style="color: #000000;">)</span> Warning W0001 Ambiguous reference: <span style="color: #ff0000;">'HB_FT_DATETIME'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">(</span><span style="color: #000000;">3872</span><span style="color: #000000;">)</span> Warning W0001 Ambiguous reference: <span style="color: #ff0000;">'NWA'</span><br />C:\adordd\adordd.prg<span style="color: #000000;">(</span><span style="color: #000000;">3977</span><span style="color: #000000;">)</span> Warning W0001 Ambiguous reference: <span style="color: #ff0000;">'UR_DBRI_RECSIZE'</span></div>[/code:3f1bm3py]
|
ADO RDD xHarbour
|
Thanks next post will be corrected.
The : syntax works with xHarbour don't know why it doesn't with Harbour.
Just comment it.
|
ADO RDD xHarbour
|
Antonio,
Which version of Fivewin and Harbour are you using?.
About this error, please check this post:
<!-- m --><a class="postlink" href="https://groups.google.com/forum/#!topic/harbour-devel/YRmO7CAlpgU">https://groups.google.com/forum/#!topic ... RmO7CAlpgU</a><!-- m -->
Thank you.
|
ADO RDD xHarbour
|
Lucas,
Ok I see it. Im using xHarbour Set 2008.
How can we call it correctly?
|
ADO RDD xHarbour
|
Done!
[code=fw:do7s9ivd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span> aWAData<span style="color: #000000;">[</span>WA_FIELDRECNO<span style="color: #000000;">]</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Properties</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Optimize"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">1</span> <br /> </div>[/code:do7s9ivd]
|
ADO RDD xHarbour
|
Antonio,
Dbcreate() should take the database from SET ADO DEFAULT DATABASE TO command, so only needs to indicate table name, as current dbcreate() from DBFCDX.
So, I would plan dbcreate() as follows.
To keep compatibility with DBFCDX, fist parameter should be table name.
Also, if you want, you can indicate separated by ; the rest of the parameters:
STATIC FUNCTION ADO_CREATE( nWA, aOpenInfo )
LOCAL aWAData := USRRDD_AREADATA( nWA )
LOCAL cTable := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 1, ";" )
LOCAL cDataBase := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 2, ";" )
LOCAL cDbEngine := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 3, ";" )
LOCAL cServer := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 4, ";" )
LOCAL cUserName := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 5, ";" )
LOCAL cPassword := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 6, ";" )
I discovered a new bug: creating an empty Access database and table, I can´t add records. I get MsgAlert() ADO ERROR UNKNOWN at function ADO_APPEND().
If I edit the Access and I add with Access a new record, I can APPEND new records with ADORDD.
Thank you.
|
ADO RDD xHarbour
|
Antonio,
[quote="AHF":2uro70p3]Im using xHarbour Set 2008.[/quote:2uro70p3]
A version 7 years old! Time to update! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG
|
ADO RDD xHarbour
|
Antonio,
[quote="AHF":j40ycfm0]But what do these functions return? The first Field expression and 2nd cfor expression or the eval result ?[/quote:j40ycfm0]
As an example:
[code=fw:j40ycfm0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">name</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">TO</span> MYINDEX <span style="color: #00C800;">FOR</span> UPPER<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">name</span> <span style="color: #000000;">)</span> = <span style="color: #ff0000;">"A"</span></div>[/code:j40ycfm0]
But please note that UPPER() is only a sample. Another example:
[code=fw:j40ycfm0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> GETTOTALINCOME<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">TO</span> MYINDEX <span style="color: #00C800;">FOR</span> GETTOTALINCOME<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> >= <span style="color: #000000;">1000</span></div>[/code:j40ycfm0]
EMG
|
ADO RDD xHarbour
|
Enrico,
[code=fw:3ngjjgwt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">name</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">TO</span> MYINDEX <span style="color: #00C800;">FOR</span> UPPER<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">name</span> <span style="color: #000000;">)</span> = <span style="color: #ff0000;">"A"</span></div>[/code:3ngjjgwt]
This works. All you have to do is to replace UPPER with SQL UCASE or other SQL equivalent.
[code=fw:3ngjjgwt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">name</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">TO</span> MYINDEX <span style="color: #00C800;">FOR</span> <span style="color: #ff0000;">"UCASE("</span>+ FIELD -> <span style="color: #0000ff;">name</span> +<span style="color: #ff0000;">")"</span> = <span style="color: #ff0000;">"A"</span></div>[/code:3ngjjgwt]
This should work also like this:
[code=fw:3ngjjgwt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> &<span style="color: #000000;">(</span>GETTOTALINCOME<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">TO</span> MYINDEX <span style="color: #00C800;">FOR</span> &<span style="color: #000000;">(</span>GETTOTALINCOME<span style="color: #000000;">(</span> FIELD -> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span>+ <span style="color: #ff0000;">">= 1000"</span></div>[/code:3ngjjgwt]
|
ADO RDD xHarbour
|
Antonio,
And how we define such indexes on the commands fro ADORDD.
Thanks.
|
ADO RDD xHarbour
|
Antonio,
this would mean to review all my code and I can't afford it.
EMG
|
ADO RDD xHarbour
|
[quote="lucasdebeltran":3tofgg7z]Antonio,
And how we define such indexes on the commands fro ADORDD.
Thanks.[/quote:3tofgg7z]
Lucas,
Replace it in every place such as:
[code=fw:3tofgg7z]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">IF</span> RDDNAME<span style="color: #000000;">(</span><span style="color: #000000;">)</span> = <span style="color: #ff0000;">"ADORDD"</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> ...<br /><span style="color: #00C800;">ELSE</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> as it is <br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:3tofgg7z]
Or maybe you can include a command change in INDEX ON... to foresee this situation.
I dont have such a problem because this app already works with ADS.
|
ADO RDD xHarbour
|
[quote="lucasdebeltran":1bzwckbt]Antonio,
Dbcreate() should take the database from SET ADO DEFAULT DATABASE TO command, so only needs to indicate table name, as current dbcreate() from DBFCDX.
So, I would plan dbcreate() as follows.
To keep compatibility with DBFCDX, fist parameter should be table name.
Also, if you want, you can indicate separated by ; the rest of the parameters:
STATIC FUNCTION ADO_CREATE( nWA, aOpenInfo )
LOCAL aWAData := USRRDD_AREADATA( nWA )
LOCAL cTable := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 1, ";" )
LOCAL cDataBase := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 2, ";" )
LOCAL cDbEngine := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 3, ";" )
LOCAL cServer := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 4, ";" )
LOCAL cUserName := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 5, ";" )
LOCAL cPassword := hb_tokenGet( aOpenInfo[ UR_OI_NAME ], 6, ";" )
[/quote:1bzwckbt]
I agree. Changes will be made in the next post.
[quote:1bzwckbt]
I discovered a new bug: creating an empty Access database and table, I can´t add records. I get MsgAlert() ADO ERROR UNKNOWN at function ADO_APPEND().
If I edit the Access and I add with Access a new record, I can APPEND new records with ADORDD.
[/quote:1bzwckbt]
Sorry I know that's due to our trials in ADO_LOCK because of concurrent access control.
We must be sure that we have the recordset with most recent table information (new and deleted records included).
Thanks for your support
|
ADO RDD xHarbour
|
Antonio,
First trials on real world went very well.
Trials will continue during this week.
Still didn't change one line of code in the app. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
The only problem found its concerning performance of DBEVAL that translates to ADO_EVALBLOCK.
It takes an "eternity" to run. Something is wrong.
[code=fw:zx2tl9u1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_EVALBLOCK<span style="color: #000000;">(</span> nArea, bBlock, uResult <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> nCurrArea<br /><br /> <br /> nCurrArea := <span style="color: #0000ff;">Select</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> nCurrArea != nArea<br /> dbSelectArea<span style="color: #000000;">(</span> nArea <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> nCurrArea := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <br /> <span style="color: #00C800;">IF</span> PROCNAME<span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span> <> <span style="color: #ff0000;">"ADO_RELEVAL"</span><br /> <span style="color: #B900B9;">// DONT KNOW WHY BUT DBEVAL ONLY WORK LIKE THIS</span><br /> <span style="color: #B900B9;">//uResult := Eval( bBlock )</span><br /> <br /> UR_SUPER_EVALBLOCK<span style="color: #000000;">(</span> nArea, bBlock, uResult <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span> <br /> uResult := Eval<span style="color: #000000;">(</span> bBlock <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <br /> <span style="color: #00C800;">IF</span> nCurrArea > <span style="color: #000000;">0</span><br /> dbSelectArea<span style="color: #000000;">(</span> nCurrArea <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <br /> <br /> <span style="color: #00C800;">RETURN</span> HB_SUCCESS<br /> </div>[/code:zx2tl9u1]
I m passing to UR_SUPER_EVALBLOCK otherwise I loose bBlock value.
How can I get the rest of the parameters of this function ?
[<bForCondition>] , ;
[<bWhileCondition>], ;
[<nNextRecords>] , ;
[<nRecord>] , ;
[<lRest>]
There must be a function call by UR_SUPER_EVALBLOCK where all parameters are saved.
|
ADO RDD xHarbour
|
Antonio,
[quote="AHF":17c8ct5h]First trials on real world went very well.
Trials will continue during this week.
Still didn't change one line of code in the app. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> [/quote:17c8ct5h]
Can we use something like this?
[code=fw:17c8ct5h]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> MYFUNC1<span style="color: #000000;">(</span> myparams <span style="color: #000000;">)</span> <span style="color: #0000ff;">TO</span> MYINDEX <span style="color: #00C800;">FOR</span> MYFUNC2<span style="color: #000000;">(</span> myparams <span style="color: #000000;">)</span></div>[/code:17c8ct5h]
EMG
|
ADO RDD xHarbour
|
[quote="Enrico Maria Giordano":31n06l2w]Antonio,
[quote="AHF":31n06l2w]First trials on real world went very well.
Trials will continue during this week.
Still didn't change one line of code in the app. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> [/quote:31n06l2w]
Can we use something like this?
[code=fw:31n06l2w]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> MYFUNC1<span style="color: #000000;">(</span> myparams <span style="color: #000000;">)</span> <span style="color: #0000ff;">TO</span> MYINDEX <span style="color: #00C800;">FOR</span> MYFUNC2<span style="color: #000000;">(</span> myparams <span style="color: #000000;">)</span></div>[/code:31n06l2w]
EMG[/quote:31n06l2w]
Enrico,
As long as its evaluated before send it to adordd I would say yes.
Ex.
[code=fw:31n06l2w]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> cexpress1 := <span style="color: #ff0000;">"field1 <> space(10)"</span><br /> cexpress2 := <span style="color: #ff0000;">"field2+field3 ='"</span>+ <span style="color: #000000;">(</span>wcod<span style="color: #000000;">)</span>+<span style="color: #ff0000;">"'"</span><br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> field2+field3+str<span style="color: #000000;">(</span>val<span style="color: #000000;">(</span>field4<span style="color: #000000;">)</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">(</span>temporario<span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">while</span> &<span style="color: #000000;">(</span>cexpress2<span style="color: #000000;">)</span> <span style="color: #00C800;">for</span> &<span style="color: #000000;">(</span>cexpress1<span style="color: #000000;">)</span>;<br /> </div>[/code:31n06l2w]
Please note that this is the only exception where you need to change code.
Check readme at github.
Fortunately the app we are adapting was working already with ADS thus this has already been done in the past.
|
ADO RDD xHarbour
|
Antonio,
[quote="AHF":105xwjeh]As long as its evaluated before send it to adordd I would say yes.[/quote:105xwjeh]
No, they can't be evaluated in advance. So ADORDD is of no use for me. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
EMG
|
ADO RDD xHarbour
|
Enrico,
I regret <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Cant you work also with ADS?
Cant you somehow translated to a SQL SELECT ?
|
ADO RDD xHarbour
|
Antonio,
No, to all your questions. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
EMG
|
ADO RDD xHarbour
|
Antonio,
Have you been able to fix the APPEND bug?.
Thank you.
|
ADO RDD xHarbour
|
Lucas,
Yes.
Ill try to post new version during today.
|
ADO RDD xHarbour
|
[quote="Enrico Maria Giordano":31nni8ag]Antonio,
No, to all your questions. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
EMG[/quote:31nni8ag]
Enrico,
Can it work like this?
index on &( MyFunc( myparams ) ) TO TEMP1 FOR &( MyFunc2( myparams ) )
|
ADO RDD xHarbour
|
Antonio,
Thank you. Please ensure it works fine by deleting [i:14hzh2be]previously[/i:14hzh2be] the database, and next create the database and its tables.
Also, I guess LOCATE FOR now works as DBFCDX:
[code=fw:14hzh2be]<div class="fw" id="{CB}" style="font-family: monospace;">LOCATE <span style="color: #00C800;">FOR</span> FIELD->NAME == <span style="color: #ff0000;">"Lucas"</span></div>[/code:14hzh2be]
In addition, SET ADO LOCK CONTROL SHAREPATH TO should asume by default HB_DIRBASE(). If the programmer does want to change the path, so it should call this command.
About the indexes, are SET ADO TABLES INDEX LIST TO and SET ADODBF TABLES INDEX LIST TO are [i:14hzh2be]both [/i:14hzh2be]required?.
Thank you.
|
ADO RDD xHarbour
|
Antonio,
[quote="AHF":30xx1vz6]Can it work like this?
index on &( MyFunc( myparams ) ) TO TEMP1 FOR &( MyFunc2( myparams ) )[/quote:30xx1vz6]
No, as "myparams" can be a field name. It has to be completely dynamic.
EMG
|
ADO RDD xHarbour
|
[quote="Enrico Maria Giordano":2truptw1]Antonio,
[quote="AHF":2truptw1]Can it work like this?
index on &( MyFunc( myparams ) ) TO TEMP1 FOR &( MyFunc2( myparams ) )[/quote:2truptw1]
No, as "myparams" can be a field name. It has to be completely dynamic.
EMG[/quote:2truptw1]
Enrico,
But what do these functions return? The first Field expression and 2nd cfor expression or the eval result ?
|
ADO RDD xHarbour
|
Antonio,
No, sorry, I ment about SET ADO TABLES INDEX LIST TO <array> and SET ADODBF TABLES INDEX LIST TO commands for such indexes.
Thank you.
|
ADO RDD xHarbour
|
[quote="lucasdebeltran":1x78evut]Antonio,
No, sorry, I ment about SET ADO TABLES INDEX LIST TO <array> and SET ADODBF TABLES INDEX LIST TO commands for such indexes.
Thank you.[/quote:1x78evut]
Lucas,
I didnt tried I dont have such case.
|
ADO RDD xHarbour
|
Antonio,
Im having a problem with APPEND FROM and COPY TO due to the fact that the scope info array never delivers cForExp and cWhileExp only the code blocks!
This disable us to construct the INSERT INTO with WHERE clause.
Is there any way to get these as literal expressions?
|
ADO RDD xHarbour
|
Antonio,
I mean, for Enrico´s indexes if you could clarify what SET ADO TABLES INDEX LIST TO ... and SET ADODBF TABLES INDEX LIST TO ... should be.
Their usage is not clear neither in source code nor readme.txt.
Thank you.
|
ADO RDD xHarbour
|
Lucas,
SET ADO TABLES INDEX LIST TO = indexes without of any clipper like expression only to be used by SQL
SET ADODBF TABLES INDEX LIST TO = indexes with the clipper like expressions needed by the app for its evaluations.
When we use &(indexkey(0)) we cant evaluate a index expression in ADO TABLES "name+dDate+nValue" we will get an error but we can issues a sql select like that.
Thus we need the ADODBF expression "name+DTOS(dDate)+STR(nValue) to do it.
The ADO indexes are for queries the ADODBF are for the normal clipper expressions to allow its evaluation.
Concerning the kind of Enrico indexes since the params are dynamic I assume that they are dynamically created each time they are needed so they dont need to be present in these arrays.
Im finishing APPEND FROM and COPY TO guessing and testing params because the doc its none.
I hope to have it ready tomorrow and Ill post a new version with all NORMAL rdd routines working.
|
ADO RDD xHarbour
|
Antonio,
Thank you.
Have you checked out arrayrdd source code?.
|
ADO RDD xHarbour
|
Lucas,
[quote:240f19js]Have you checked out arrayrdd source code?.[/quote:240f19js]
Yes but find nothing concerning append or copy.
|
ADO RDD xHarbour
|
Completed version adordd at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m -->
|
ADO RDD xHarbour
|
Antonio,
How can I get the complete file name of an open area?
I need this to COPY TO.
|
ADO RDD xHarbour
|
[code=fw:6f8cw1d9]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dbinfo.ch"</span><br />dbInfo<span style="color: #000000;">(</span>DBI_FULLPATH<span style="color: #000000;">)</span></div>[/code:6f8cw1d9]
|
ADO RDD xHarbour
|
Of course!
Thanks.
|
ADO RDD xHarbour
|
Im facing the following problem:
When we use Date() to place in a date field should it be Date() or Sql Now() ?
If there are several workstations in different time zones and if the field date corresponds for ex. to an order number to have last order number with the last date this might fail.
On other hand working with sql Now() brings also problems that the document might have a date posterior to the actual date which means the doc shouldn't be use before that date.
In the cases where there aren't any relations between numbers and dates can it be always sql Now()?
What is your experience? Can you share it?
|
ADO RDD xHarbour
|
New version adordd <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m -->
Check readme
|
ADO RDD xHarbour
|
Antonio, in adordd.prg you use often:
[code=fw:2x9njag2]<div class="fw" id="{CB}" style="font-family: monospace;">ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nRecord,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span></div>[/code:2x9njag2]
This code produces a error! STR with len 0 is not allowed?
In some cases the parameter nRecord ist from type "C" and a runtime-error is displayed if following code in adordd.prg is called from tryadordd.prg:
[code=fw:2x9njag2]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Relations in ADO SQL with record number are not allowed! See adordd.prg"</span><span style="color: #000000;">)</span><br /> nReturn := ADO_GOTO<span style="color: #000000;">(</span> aRelInfo<span style="color: #000000;">[</span> UR_RI_CHILD <span style="color: #000000;">]</span>, uResult <span style="color: #000000;">)</span> <span style="color: #B900B9;">//-> uResult is type "C"</span><br /><br /> </div>[/code:2x9njag2]In tryadordd the database and table should be: [code=fw:2x9njag2]<div class="fw" id="{CB}" style="font-family: monospace;">DbCreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"table1;"</span>+cPath+<span style="color: #ff0000;">"<span style="color: #000000;">\t</span>est2.mdb"</span>, ....</div>[/code:2x9njag2] and [code=fw:2x9njag2]<div class="fw" id="{CB}" style="font-family: monospace;">DbCreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"table2;"</span>+cPath+<span style="color: #ff0000;">"<span style="color: #000000;">\t</span>est2.mdb"</span>,...</div>[/code:2x9njag2]
|
ADO RDD xHarbour
|
[quote:1spwvvn6]
Code:
ALLTRIM(STR(nRecord,0))
This code produces a error! STR with len 0 is not allowed?
[/quote:1spwvvn6]
You are absolutely right!
The strange its that here with xHarbour Set 2008 this is accepted. No error!
Corrected anyway! The length should be 10,0
[quote:1spwvvn6]
In some cases the parameter nRecord ist from type "C" and a runtime-error is displayed if following code in adordd.prg is called from tryadordd.prg:
Code:
MSGINFO("Relations in ADO SQL with record number are not allowed! See adordd.prg")
nReturn := ADO_GOTO( aRelInfo[ UR_RI_CHILD ], uResult ) //-> uResult is type "C"
[/quote:1spwvvn6]
The nRecord its always N type.
Unless bookmarks are used and with it the results will be unpredictable. (no defined field as recno)
The ADOGOTO was left there by mistake when we were trying it.
Corrected taken out.
You only (should ) get there if there is a relation and no index.
In tryadordd.prg you're right I changed the dbcreate proposed by Lucas and I forgot to change tryadordd.
Thanks a lot for your comments.
Is adordd working ok for you?
It will be a great help to have your feed back.
|
ADO RDD xHarbour
|
Antonio, in the command SET ADO LOCK CONTROL SHAREPATH TO cPath RDD TO "DBFCDX" you sets the RDD for tlocks.dbf. In the code of adordd.prg should the extension from the indexfile not hardcoded ("CDX") as if i use another RDD the extension is another one! This hardcoded "CDX" are present on some places!
Little correction: The right text in STATIC FUNCTION ADO_RELEVAL( nWA, aRelInfo ) is "allowed"
In tryadordd.prg the relation should finished after the Do WHILE...
MSGINFO("DOES TABLE1 EXISTS ON DB ?"+CVALTOCHAR(hb_adoRddExistsTable( "table1") )) shows .F. ???
|
ADO RDD xHarbour
|
byte-one,
Ill change it to IndexExt() and TableExt()
[quote:1rydea7s]Little correction: The right text in STATIC FUNCTION ADO_RELEVAL( nWA, aRelInfo ) is "allowed"[/quote:1rydea7s]
Sorry Im not getting it.
If you want to test it simply place SET RELATION TO or not if you want try it browse fields from 2 areas to see it.
hb_adoRddExistsTable - This only queries the Schema I think if you are using Access it doesn't work.
I didn't do it because who wants access when you can have any SQL database?
Thanks for your info.
|
ADO RDD xHarbour
|
Antonio,
Can you please post last version?.
In that version, dbcreate takes default database name indicated in SET ADO DEFAULT DATABASE TO command?.
Thank you.
|
ADO RDD xHarbour
|
Lucas,
I think last version posted already does that.
Please try it and inform.
May be you can help me.
Im still with a problems with dates in MYSQL.
1) Edit a date field and place any date ok.
2) Delete that date and leave it blank date ok
3) Edit again and place a new date ok bu if edit iit again and keep the date blank error!
I try with adoshowerror but nothing only unknown error.
Do you have any clue?
How can we set a date field with empty date?
|
ADO RDD xHarbour
|
Antonio,
It´s not working:
After creating a new table:
Error description: (DOS Error 2) DBFCDX/1003 Open error: C:\ADORDD2015\TLOCKS.CDX
Stack Calls
===========
Called from: => ORDLISTADD( 0 )
Called from: ../../../rddord.prg => DBSETINDEX( 0 )
Called from: test.prg => ADO_GETUNLOCK( 2776 )
Also, Append does not work fine.
The first time I append a record:
[img:32hq8cs5]http://i57.tinypic.com/nyg3uw.jpg[/img:32hq8cs5]
When appending next records, it seems ok.
|
ADO RDD xHarbour
|
Lucas ,
What version are you using?
|
ADO RDD xHarbour
|
Antonio,
"AdoRdd Version 1.150515/2"
|
ADO RDD xHarbour
|
Lucas,
Error lines dont match that version.
Can you post lines here?
Tlocks file does not exist? Was not created?
|
ADO RDD xHarbour
|
Hello,
Please, try this sample:
[code=fw:1y1q83ot]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd<span style="color: #000000;">\a</span>dordd.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd<span style="color: #000000;">\a</span>dordd.prg"</span><br /><br /><br /><br />REQUEST ADORDD, DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> RddRegister<span style="color: #000000;">(</span><span style="color: #ff0000;">"ADORDD"</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> RddSetDefault<span style="color: #000000;">(</span><span style="color: #ff0000;">"ADORDD"</span><span style="color: #000000;">)</span><br /><br /><br /> SET ADODBF TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS1"</span>, <span style="color: #ff0000;">"NOMBRE"</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /><br /> SET ADO TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">{</span><span style="color: #000000;">{</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS1"</span>, <span style="color: #ff0000;">"NOMBRE"</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /><br /> SET ADO <span style="color: #00C800;">DEFAULT</span> RECNO FIELD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ID"</span><br /><br /> <span style="color: #B900B9;">// SET AUTOPEN ON //might be OFF if you wish</span><br /> <span style="color: #B900B9;">// SET AUTORDER TO 1 // first index opened can be other</span><br /><br /><br /> SET ADO <span style="color: #00C800;">DEFAULT</span> DATABASE <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"LUCASTABLE.MDB"</span> ENGINE <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ACCESS"</span> USER <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span> PASSWORD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span><br /><br /><span style="color: #B900B9;">// SET ADO LOCK CONTROL SHAREPATH TO "C:" RDD TO "DBFCDX"</span><br /><br /><br /><br /> <span style="color: #00C800;">IF</span> !FILE<span style="color: #000000;">(</span> <span style="color: #ff0000;">"LUCASTABLE.MDB"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"creating LUCASTABLE.MDB"</span><span style="color: #000000;">)</span><br /><br /> DbCreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"LAST"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"AGE"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"ID"</span> ,<span style="color: #ff0000;">"+"</span>,<span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"ADORDD"</span> <span style="color: #000000;">)</span><br /><br /> DbCreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"LUCAS"</span>, <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"NOMBRE"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"ID"</span> ,<span style="color: #ff0000;">"+"</span>,<span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"ADORDD"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><br /><br /> <span style="color: #B900B9;">//</span><br /> <span style="color: #B900B9;">// Open DBFS</span><br /> USE LUCAS <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"LUCAS"</span><br /> LUCAS-><span style="color: #000000;">(</span>ORDSETFOCUS<span style="color: #000000;">(</span><span style="color: #ff0000;">"LUCAS1"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ?ordsetfocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> BROWSE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #B900B9;">//</span><br /> USE TABLE1 <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"TEST2"</span> <span style="color: #00C800;">NEW</span><br /> OrdSetFocus<span style="color: #000000;">(</span><span style="color: #ff0000;">"TEST1"</span><span style="color: #000000;">)</span><br /> ?ordsetfocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> TEST2-><span style="color: #000000;">(</span> OrdSetFocus<span style="color: #000000;">(</span><span style="color: #ff0000;">"TEST2"</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span>ordsetfocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + SPACE<span style="color: #000000;">(</span><span style="color: #000000;">20</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"Changed to TEST2"</span> <span style="color: #000000;">)</span><br /><br /><br /><br /> XBROWSER FASTEDIT<br /><br /><br /><br /><br /> APPEND BLANK<br /> test2->First := <span style="color: #ff0000;">"HOMER si no Homer"</span><br /> test2->Last := <span style="color: #ff0000;">"Simpson"</span><br /> test2->Age := <span style="color: #000000;">45</span><br /><br /> APPEND BLANK<br /> test2->First := cValToChar<span style="color: #000000;">(</span> nRandom<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" aaa Lara"</span><br /> test2->Last := <span style="color: #ff0000;">"Croft si no"</span><br /> test2->Age := <span style="color: #000000;">32</span><br /><br /><br /> GO TOP<br /><br /> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DbCloseAll<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1y1q83ot]
|
ADO RDD xHarbour
|
Antonio,
Also indexes with conditions do not work, here LUCAS2:
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "FOR NOMBRE = 'AGAMENON'"} } }
|
ADO RDD xHarbour
|
Lucas,
Your trial its working ok!
Please note as in Harbour before ORDSETFOCUS() you need to SET INDEX TO if SET AUTO OPEN not defined.
Appends are done ok.
Tlocks its created ok.
|
ADO RDD xHarbour
|
Lucas,
Im not working with xBrowse so I didnt try with it.
Is the problem with xbrowse? Does browse works ok?
|
ADO RDD xHarbour
|
Lucas,
Its working ok.
Correct syntax:
[code=fw:1k96a21p]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> SET ADODBF TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS1"</span>, <span style="color: #ff0000;">"NOMBRE"</span>,<span style="color: #ff0000;">"NOMBRE = 'AGAMENON'"</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /><br /> SET ADO TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">{</span><span style="color: #000000;">{</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS1"</span>, <span style="color: #ff0000;">"NOMBRE"</span>,<span style="color: #ff0000;">"WHERE NOMBRE = 'AGAMENON'"</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span> <br /> </div>[/code:1k96a21p]
|
ADO RDD xHarbour
|
Antonio,
Xbrowse seems to be working fine.
I delete tlocks and it seems to be working now.
But indexes with conditions no:
[code=fw:3vbl535g]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> SET ADO TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">{</span><span style="color: #000000;">{</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS1"</span>, <span style="color: #ff0000;">"NOMBRE"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS2"</span>, <span style="color: #ff0000;">"NOMBRE"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /> SET ADODBF TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"TABLE1"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST1"</span>, <span style="color: #ff0000;">"FIRST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST2"</span>, <span style="color: #ff0000;">"LAST"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"TEST3"</span>, <span style="color: #ff0000;">"AGE"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS"</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS1"</span>, <span style="color: #ff0000;">"NOMBRE"</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"LUCAS2"</span>, <span style="color: #ff0000;">"NOMBRE"</span>, <span style="color: #ff0000;">"WHERE NOMBRE = 'AGAMENON'"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /> <span style="color: #B900B9;">//</span><br /> <span style="color: #B900B9;">// Open DBFS</span><br /> USE LUCAS <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"LUCAS"</span><br /> LUCAS-><span style="color: #000000;">(</span>ORDSETFOCUS<span style="color: #000000;">(</span><span style="color: #ff0000;">"LUCAS1"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ?ordsetfocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> BROWSE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> LUCAS-><span style="color: #000000;">(</span>ORDSETFOCUS<span style="color: #000000;">(</span><span style="color: #ff0000;">"LUCAS2"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> dbgotop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ?ordsetfocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> xbrowser fastedit<br /><br /><br /><br /> </div>[/code:3vbl535g]
LUCAS2 index does not eval the condition.
|
ADO RDD xHarbour
|
Lucas,
Place in adordd at line 2231 MSGINFO(CSQL) is teh select correct?
|
ADO RDD xHarbour
|
In wich function?.
I had to remove some of your starting code at adordd.prg so as to compile with Harbour.
|
ADO RDD xHarbour
|
Lucas,
Index condition its working
Lucas table its empty I try it with:
{"TEST3", "AGE","WHERE AGE = 32"} }
Please place this function in your trials to check rdd status.
[code=fw:2voeyzei]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> rddreport<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">LOCAL</span> cerrorlog := <span style="color: #ff0000;">""</span>,n,j,ntarget,x<br /><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">255</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cErrorLog += CRLF + Str<span style="color: #000000;">(</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">": "</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">Select</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == n,<span style="color: #ff0000;">"=> "</span>, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">)</span> + ;<br /> PadR<span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span>, <span style="color: #000000;">15</span> <span style="color: #000000;">)</span> + Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"NomeRDD: "</span> + ;<br /> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> RddName<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + CRLF<br /> cErrorLog += <span style="color: #ff0000;">" =============================="</span> + CRLF<br /> cErrorLog += <span style="color: #ff0000;">" RecNo RecCount BOF EOF"</span> + CRLF<br /> cErrorLog += <span style="color: #ff0000;">" "</span> + Transform<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"99999"</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">" "</span> + Transform<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"99999"</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">" "</span> + cValToChar<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> BoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">" "</span> + cValToChar<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> EoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + CRLF + CRLF<br /> cErrorLog += <span style="color: #ff0000;">" Índices em uso "</span> + Space<span style="color: #000000;">(</span> <span style="color: #000000;">23</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"TagName"</span> + CRLF<br /> <br /> <span style="color: #00C800;">for</span> j = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">15</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> IndexKey<span style="color: #000000;">(</span> j <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cErrorLog += Space<span style="color: #000000;">(</span> <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> IndexOrd<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == j, <span style="color: #ff0000;">"=> "</span>, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">)</span> + ;<br /> PadR<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> IndexKey<span style="color: #000000;">(</span> j <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdName<span style="color: #000000;">(</span> j <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + ;<br /> CRLF<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> <br /> cErrorLog += CRLF + <span style="color: #ff0000;">" Relações em uso "</span> + CRLF<br /> <span style="color: #00C800;">for</span> j = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> nTarget := <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbRSelect<span style="color: #000000;">(</span> j <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cErrorLog += Space<span style="color: #000000;">(</span> <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> + Str<span style="color: #000000;">(</span> j <span style="color: #000000;">)</span> + <span style="color: #ff0000;">": "</span> + ;<br /> <span style="color: #ff0000;">"TO "</span> + <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbRelation<span style="color: #000000;">(</span> j <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">" INTO "</span> + <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> nTarget <span style="color: #000000;">)</span> + CRLF<br /> <span style="color: #B900B9;">// uValue = ( Alias( n ) )->( DbRelation( j ) )</span><br /> <span style="color: #B900B9;">// cErrorLog += cValToChar( &( uValue ) ) + CRLF</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> x := <span style="color: #000000;">(</span><span style="color: #0000ff;">alias</span><span style="color: #000000;">(</span>n<span style="color: #000000;">)</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbrlocklist<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cErrorLog += Space<span style="color: #000000;">(</span> <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> +<span style="color: #ff0000;">"Registos fechados "</span>+CRLF<br /> <span style="color: #00C800;">for</span> j = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span>x<span style="color: #000000;">)</span><br /> cErrorLog += Space<span style="color: #000000;">(</span> <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"Registo nr "</span>+str<span style="color: #000000;">(</span>x<span style="color: #000000;">[</span>j<span style="color: #000000;">]</span><span style="color: #000000;">)</span>+CRLF<br /> <span style="color: #00C800;">next</span><br /><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> SHOWMEMO<span style="color: #000000;">(</span>cerrorlog<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> .t.<br /><br /> </div>[/code:2voeyzei]
|
ADO RDD xHarbour
|
Lucas,
[quote:319bs5u7]
May be you can help me.
Im still with a problems with dates in MYSQL.
1) Edit a date field and place any date ok.
2) Delete that date and leave it blank date ok
3) Edit again and place a new date ok bu if edit iit again and keep the date blank error!
I try with adoshowerror but nothing only unknown error.
Do you have any clue?
How can we set a date field with empty date?
[/quote:319bs5u7]
Can you help me with this?
|
ADO RDD xHarbour
|
Antonio,
Where are you putting this?
{"TEST3", "AGE","WHERE AGE = 32"} }
In SET ADO TABLES or in SET ADODBF TABLES?.
As long as I can´t use adordd in a full working application, I can´t test dates behaviour.
|
ADO RDD xHarbour
|
Lucas,
[quote:j4ig4go9]Where are you putting this?
{"TEST3", "AGE","WHERE AGE = 32"} }
In SET ADO TABLES or in SET ADODBF TABLES?.
[/quote:j4ig4go9]
In SET ADO TABLES the sql expressions never clipper expression
In SET ADODBF TABLES only clipper expressions. In conditions please don't place FOR or WHILE keyword but only the condition.Ex "AGE = 32"
That s it.
[quote:j4ig4go9]As long as I can´t use adordd in a full working application, I can´t test dates behaviour.[/quote:j4ig4go9]
If you create a date field in your trail DB you will see what is the problem when changing it to empty.
|
ADO RDD xHarbour
|
Antonio,
It´s not working:
SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", },;
{"LUCAS3", "NOMBRE"} } }
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
[b:hgsr4iey] {"LUCAS2", "NOMBRE", "NOMBRE = 'AGAMENON'"},;
{"LUCAS3", "NOMBRE", "ACTIVO = .T." } } }[/b:hgsr4iey]
I set ordsetfocus to LUCAS2 or LUCAS3 with NO LUCK.
|
ADO RDD xHarbour
|
[quote:34dn17c8]
1: => LUCAS NomeRDD: ADORDD
==============================
RecNo RecCount BOF EOF
2 3 .F. .F.
Índices em uso TagName
NOMBRE LUCAS1
NOMBRE LUCAS2
=> NOMBRE LUCAS3
Relações em uso
Registos fechados
[/quote:34dn17c8]
|
ADO RDD xHarbour
|
Lucas,
Try it like this:
//sql expressions only
SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "WHERE NOMBRE = 'AGAMENON'"},;
{"LUCAS3", "NOMBRE","WHERE ACTIVO = TRUE" } } } //Maybe its not TRUE but 1 I dont know
//clipper expression only
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "NOMBRE = 'AGAMENON'"},;
{"LUCAS3", "NOMBRE", "ACTIVO = .T." } } }
Note that when doing this with INDEX ON you only have to use standard clipper expression INDEX ON NOMBRE TO LUCAS3 FOR ACTIVO = .T.
|
ADO RDD xHarbour
|
Antonio,
I guessed that conditions and functions went only to SET ADODBF, as to keep Clipper compatibility.
Now I realze I have to indicate the condition or functions in both cases -SET ADO TABLES and SET ADODBF TABLES-, so in order to be clear, why use only one way?.
I also talked with other users and they agree on considering such point very confusing.
Dates are working fine.
That´s the problem of using such an old version of xHarbour.
Thank you.
|
ADO RDD xHarbour
|
Lucas,
[quote:8tg2n5i6]Now I realze I have to indicate the condition or functions in both cases -SET ADO TABLES and SET ADODBF TABLES-, so in order to be clear, why use only one way?.
I also talked with other users and they agree on considering such point very confusing.[/quote:8tg2n5i6]
Dont understand what you mean.
[quote:8tg2n5i6]Dates are working fine.
That´s the problem of using such an old version of xHarbour.[/quote:8tg2n5i6]
Great!
Do you know any workaround? I cant update now.
|
ADO RDD xHarbour
|
Antonio,
For and while and all Index parameters should be indicated either one way, Clipper or sql format.
|
ADO RDD xHarbour
|
Lucas,
[quote:g4t35176]I guessed that conditions and functions went only to SET ADODBF, as to keep Clipper compatibility.[/quote:g4t35176]
Please note that functions need to be different.
Ex
SQL UCASE = CLIPPER UPPER
SQL LCASE = CLIPPER LOWER
So we must enter each corresponding function into SET ADO or SET ADODBF.
Also please note that as in other rdds such as ADS all functions and vars in indexes must be evaluated before sending it to the server as the funcs or vars do not exist there.
[quote:g4t35176]For and while and all Index parameters should be indicated either one way, Clipper or sql format.[/quote:g4t35176]
It can be done but its a lot of program work because then adordd would have to make all parsing of all expressions. Its a lot of program work, trial and subject to bugs.
We always need 2 expressions one for clipper another for sql and they can be much different.
All clipper functions as ordfor() indexkey() etc need the clipper expression.
You cannot run indexkey() over a sql expression "NAME+AGE+DATE"
You need "NAME+STR(AGE)+DTOC(DATE)" but you can not run sql with this.
This is much simpler and if there is a problem we know immediately where it is.
This is only defined one place in the app and thats it.
If someone wants to do it like that great but I dont have the time.
|
ADO RDD xHarbour
|
Lucas,
Dates did you try it with mysql?
|
ADO RDD xHarbour
|
Antonio,
Not yet, but I remember that there were some issues with dates. I have to check.
Also, about updating xHarbour, unless there is a pcode change, which I doubt, you will be able to keep your Fivewin version, which I guess is what you want.
|
ADO RDD xHarbour
|
Lucas,
With MySql the date field problem is:
If the new value its a empty date and we do:
[code=fw:1w5zg8kh]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00C800;">IF</span> ADO_FIELDSTRUCT<span style="color: #000000;">(</span> oRecordSet, nField<span style="color: #000000;">-1</span> <span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> $ <span style="color: #ff0000;">"DT"</span> .AND. EMPTY<span style="color: #000000;">(</span>xValue<span style="color: #000000;">)</span><br /> xValue :=<span style="color: #000000;">0</span><br /><span style="color: #00C800;">ENDIF</span><br /> <br />oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span> nField - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := xValue<br /> <br />oRecordSet:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:1w5zg8kh]
Its ok but the field date keeps a value of 1899-12-31 can not be!
If we use instead of xValue :=0 xValue :=ADONULL() date field is empty but :Update() errors!
Any ideas?
|
ADO RDD xHarbour
|
Antonio,
I have found those big errors so far:
DbCommitAll() produces an error:
[img:72nfsmv1]http://i62.tinypic.com/a3fbit.png[/img:72nfsmv1]
This filter produces a GPF and a hb_out.log:
SET FILTER TO alltrim(AUXILIAR->RELACION) == alltrim(cValToChar( cCodigo ))
I also have minor things for other post.
Thank you.
|
ADO RDD xHarbour
|
Lucas,
Can you send me by mail Tdatarow and trecset?
Do you mean then update with dbcommit or skip (ado already does this) as in clipper?
OK Ill tested it with access.
Dbcreate its being done checking file exist.
As for FILE and to keep app code compatibility the ideal was to alter the file function itself to work with adordd or any other file.
Where can I find it?
Browses are ok?
Locks are ok?
Navigation ok?
|
ADO RDD xHarbour
|
Lucas,
This seems not serious.
Dbcomittall() call ado_flush() that calls :updated() I dont know why it errors like that.
Here with Mysql sometimes gives also error NOT Supported.
Probably because there aren't any pending updates?
My idea its to enclose it in TRY CATCH. with catch doing nothing.
In all my trials with MySQL and oledb ADS doesn't seem to have any bad effect.
What do you think?
About filter:
Filter2sql this has been taken from the actual app used with ADS.
All harbour used functions must be defined there.
I believe that cvaltochar its not. Please try STR.
Filter2Sql is used by the app we are using with adordd and it wasn't written by us.
Its indexkey and ordfor aware.
Also please be aware that using filters we have to ensure that besides the filter block there is a filter literal expression.
In the app they use it like this :
dbsetfilter(&("{ || " + cfilter + "}"), ;
cfilter )
Please check .ppo file if translates to that.
Please check filter2sql and if you need Ill try to help you adding new functions to the arrays.
This fully satisfy our client needs thats why we didn't changed it.
|
ADO RDD xHarbour
|
Antonio,
With set filter to, I changed cvaltochar to str, and I still have the gpf.
Maybe the conversión into SQL is not good:
[img:8now11gj]http://i60.tinypic.com/2dqiv7.png[/img:8now11gj]
Also, in dbseek -STATIC FUNCTION ADOSEEKSQLFIND()-, there is an error with # and numeric fields. You call to:
SELECT CUSTOMER.* FROM CUSTOMER WHERE CODIGO=#10# ORDER BY CODIGO
But in ADO should be:
SELECT CUSTOMER.* FROM CUSTOMER WHERE CODIGO=10 ORDER BY CODIGO
Also, when appending a dbf with 30 fields, I get:
Error description: (DOS Error -2147352567) WINOLE/1006 Record is too large. (0x80040E21): Microsoft JET Database Engine
Args:
[ 1] = C
Stack Calls
===========
Called from: => TOLEAUTO:_VALUE( 0 )
Called from: source\adordd.prg => ADO_PUTVALUE( 1414 )
ADO_PUTVALUE( 1414 )
oRecordSet:Fields( nField - 1 ):Value := xValue
Thank you.
|
ADO RDD xHarbour
|
Lucas,
Sorry I forgot that Filter2sql definitely does not work with ACCESS.
I place filter2sql in adordd but still only works with oledb for ADS it misses other DBs syntax.
If you want please try :FILTER with SQLTRANSLATE instead
Filters will be done within coming weeks.
About seek this was left overs from trials please test instead of
cSql := IndexBuildExp(nWA,aWAData[WA_INDEXACTIVE],aWAData,.F.,IF(aSeek[3],aseek[1],aSeek[2] ))
this:
cSql := IndexBuildExp(nWA,aWAData[WA_INDEXACTIVE],aWAData,.F.,aSeek[2] )
aseek[1] it was expression to use with :find.
Ill change it here for next post.
Append
[code=fw:5yxct79i]<div class="fw" id="{CB}" style="font-family: monospace;">Error description: <span style="color: #000000;"><span style="color: #000000;">(</span>DOS</span> Error <span style="color: #000000;">-2147352567</span><span style="color: #000000;">)</span> WINOLE/<span style="color: #000000;">1006</span> Record is too large. <span style="color: #000000;">(</span>0x80040E21<span style="color: #000000;">)</span>: <span style="color: #000000;">Microsoft</span> JET Database Engine</div>[/code:5yxct79i]
I have not any idea what this error is maybe Rao or Rick can help us.
Here with mysql there isnt any problem
We append with more than 30 fields.
The error doesnt seem to be append but edit as ADO_PUTVALUE I think its not called from ADO_APPEND.
Please check also field types (any dates?)
There was a bug in your version please replace the function might solve it although I dont think.
[code=fw:5yxct79i]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> ADOSTRUCT<span style="color: #000000;">(</span> oRs <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> aStruct := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">LOCAL</span> n<br /><br /> <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> oRs:<span style="color: #000000;">Fields</span>:<span style="color: #0000ff;">Count</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">-1</span><br /> AADD<span style="color: #000000;">(</span> aStruct, ADO_FIELDSTRUCT<span style="color: #000000;">(</span> oRs, n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #00C800;">RETURN</span> aStruct </div>[/code:5yxct79i]
|
ADO RDD xHarbour
|
Antonio,
Append blank and error with dates are related.
Tdatarow does it in a different way, it updates at once all fields.
Try to comment out oRecordSet:Update() at ADO_PUTVALUE( nWA, nField, xValue ).
For filtering, maybe in tRecSet class there is a method.
Remember, once you work with Acess you will be able to work with the rest of rbdms, including MySQL. Opposite is not true, as mysql has own functions not supported by ADO.
Also, for future you may take into acount:
Issuing dbcreate when the table is already created does not arrise an error. Or previousy check if the table exists or not; if yes, don´t create.
An equivalent function for IF FILE "MYDBF.DBF", as now should reflect as a table into a database.
Adofuncs.prg provide such functions.
Thanks.
|
ADO RDD xHarbour
|
Antonio,
This could be the fix for FUNCTION ADO_PUTVALUE( nWA, nField, xValue ):
[code=fw:18c6nevb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">//oRecordSet:Fields( nField - 1 ):Value := xValue</span><br /> <span style="color: #B900B9;">//oRecordSet:Update()</span><br /><br /> oRecordSet:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span> nField - <span style="color: #000000;">1</span>, IfNil<span style="color: #000000;">(</span> xValue, AdoNull<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:18c6nevb]
But ADO_APPEND( nWA, lUnLockAll ) is still failing with Record is too large. (Error 3047). Here we need Mr. Enrico, Mr. Rick or Mr. Nages advice.
Also SET SCOPE TO nVal, where nVal is a numeric fails too.
About filtering, why don´t you use ADO command Filter()?.
As those erros are still present, I can´´t work with my App.
|
ADO RDD xHarbour
|
Lucas,
[quote:2hmj5ugh]oRecordSet:Update( nField - 1, IfNil( xValue, AdoNull() ) )[/quote:2hmj5ugh]
Im going to try it.
The date errors only happens (MySql) when you edit a empty date and save the same empty date.
Thats why we didnt have found it before although the app makes lot of transactions but never in this circumstance.
When the user in a browse does that errors.
I know that expressions with numbers in SCOPES and perhaps INDEX mail fail. Fortunatly we dont have such cases in the app. Ill give it a look asap.
The app we are working doesnt have SCOPES so its done but never tried.
Can you post an example based on your trial tables?
Our client wants the filters as they have with ADS. They are lightning fast thus we have to do it that way.
Filters we will convert it for now to Mysql expressions only.
About record size we dont have the error here. We have tables with more than 60 fields.
Ive try it already with Mysql and Access.
What is the record size causing your problem?
|
ADO RDD xHarbour
|
Antonio,
What is your email to send the database?.
The database has some fields with 80 or more chars.
About scopes, try to do
SET SCOPE TO ID = 10
|
ADO RDD xHarbour
|
Lucas,
I tried your code last post.
Result is the same if I edit a field date in browse() with an empty date and make enter with empty date errors.
If I do the same but enter a date ok
If I do the same and clean that date ok
disal.antonio.ferreira at gmail.com
Ill try scopes asap
|
ADO RDD xHarbour
|
Lucas,
[quote:24j14zwf]The database has some fields with 80 or more chars.[/quote:24j14zwf]
Ours some fields with 200 chars.
Can you check exact recsize()
|
ADO RDD xHarbour
|
Yes, returns 6763.
Thanks.
|
ADO RDD xHarbour
|
Lucas,
Thanks Ill try it.
About dates the only way it works with access and mysql is placing in ADO_PUTVALUE :
[code=fw:84c582us]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">IF</span> ADO_FIELDSTRUCT<span style="color: #000000;">(</span> oRecordSet, nField<span style="color: #000000;">-1</span> <span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> $ <span style="color: #ff0000;">"DT"</span> .AND. <span style="color: #000000;">(</span>EMPTY<span style="color: #000000;">(</span>xValue<span style="color: #000000;">)</span> .OR. FW_TTOD<span style="color: #000000;">(</span> xValue <span style="color: #000000;">)</span> == <span style="color: #000000;">{</span>^ <span style="color: #000000;">1899</span>/<span style="color: #000000;">12</span>/<span style="color: #000000;">30</span> <span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /><br /> xValue := <span style="color: #000000;">0</span><br /><br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:84c582us]
But Ill get back to the problem that the date field stays with 31/12/1899.
SQL dates support dates from 01/01/1900 on maybe thats why blank dates are 31.12.1899 23:59:59
Im trying in ADO_GETVALUE() to return a empty date in this condition otherwise this doesnt work for me.
Can you try it there and confirm?
|
ADO RDD xHarbour
|
Lucas,
I think dates problem its solved. (Access Mysql oledb ADS)
Ive found out that when the field date is empty the fields:value type its "U" and can not be accessed in this state.
When we entered a field date empty and issue update with nothing it errors saying MEMBERNOTFOUND
Ill end you new version during today.
|
ADO RDD xHarbour
|
Antonio,
SET SCOPE fix seems to be:
STATIC FUNCTION ADOSCOPE(nWA,aWAdata, oRecordSet, aOrderInfo,nIndex)
IF LEN(ALLTRIM( cvaltochar(aWAData[ WA_SCOPETOP ][y]) + cvaltochar(aWAData[ WA_SCOPEBOT ][y])) ) > 0
Scopetop and ScopeBot can be a numeric.
Fields names greater that 8 chars fail.
Also, in DbCreate() I will add the following feature. In ADOSTRUCTTOSQL( aWAData,aStruct ,lAddAutoInc) I will check if aStruct has the default ID Autoincrement field, usually called HBRECNO. If there is no autoincrement "+" field, I will add to the array:
aAdd( aStruct, { "HBRECNO", "+", 15, 0 } )
Thanks.
|
ADO RDD xHarbour
|
Lucas,
Im looking at SET SCOPE and SET FILTER.
[quote:3vb7s4yf]Fields names greater that 8 chars fail.[/quote:3vb7s4yf]
Where at scopes? Filedname() returns the :field:name
Can you try fieldname() function?
|
ADO RDD xHarbour
|
Lucas,
[quote:1shju79x]Also, in DbCreate() I will add the following feature. In ADOSTRUCTTOSQL( aWAData,aStruct ,lAddAutoInc) I will check if aStruct has the default ID Autoincrement field, usually called HBRECNO. If there is no autoincrement "+" field, I will add to the array:
aAdd( aStruct, { "HBRECNO", "+", 15, 0 } [/quote:1shju79x]
Good idea! Please post your change here.
|
ADO RDD xHarbour
|
Antonio,
[code=fw:1aqshgke]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADOSTRUCTTOSQL<span style="color: #000000;">(</span> aWAData,aStruct ,lAddAutoInc<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> cSql := <span style="color: #ff0000;">""</span>, nCol<br /> <span style="color: #00C800;">LOCAL</span> oCn := aWAData<span style="color: #000000;">[</span> WA_CONNECTION <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">LOCAL</span> dbEngine := aWAData<span style="color: #000000;">[</span> WA_ENGINE <span style="color: #000000;">]</span>, nver :=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> aEngines := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"DBASE"</span>,<span style="color: #ff0000;">"ACCESS"</span>,<span style="color: #ff0000;">"MSSQL"</span>,<span style="color: #ff0000;">"MYSQL"</span>,<span style="color: #ff0000;">"ORACLE"</span>,<span style="color: #ff0000;">"SQLITE"</span>,;<br /> <span style="color: #ff0000;">"FOXPRO"</span>,<span style="color: #ff0000;">"POSTGRE"</span>,<span style="color: #ff0000;">"INFORMIX"</span>,<span style="color: #ff0000;">"ANYWHERE"</span>,<span style="color: #ff0000;">"ADS"</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">LOCAL</span> snDbms := ASCAN<span style="color: #000000;">(</span>aEngines,dbEngine<span style="color: #000000;">)</span>,c<br /><br /><br /> <span style="color: #00C800;">if</span> AScan<span style="color: #000000;">(</span> aStruct , <span style="color: #ff0000;">"HBRECNO"</span> <span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> aAdd<span style="color: #000000;">(</span> aStruct, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"HBRECNO"</span>, <span style="color: #ff0000;">"+"</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><br /><br /> </div>[/code:1aqshgke]
|
ADO RDD xHarbour
|
Lucas,
Thanks.
About fieldname we are limited to 10 chars long not 8
This its (x)Harbour limitation. adordd simply returns :field:name but then usrrdd cuts it to 10 chars long.
For us no problem is it for you? Although this is a huge limitation in SQL.
We need Antonio to help us solve this limitation.
|
ADO RDD xHarbour
|
Antonio,
aWAData[ WA_SCOPETOP ][y] and aWAData[ WA_SCOPEBOT ][y] seems that are SCOPE´s values.
You are issuing LEN(ALLTRIM( ..., but those Scope values could be a number, or a date, so that´s why it fails.
|
ADO RDD xHarbour
|
Lucas,
We can use
[code=fw:2u04vt8n]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPETOP <span style="color: #000000;">]</span><span style="color: #000000;">[</span>y<span style="color: #000000;">]</span><span style="color: #000000;">)</span> .OR. !EMPTY<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPEBOT <span style="color: #000000;">]</span><span style="color: #000000;">[</span>y<span style="color: #000000;">]</span><span style="color: #000000;">)</span></div>[/code:2u04vt8n]
Can you try it?
|
ADO RDD xHarbour
|
Lucas,
There another bug in adoscope.
Please replace with this code: (note the 2 commented aadd)
[code=fw:lglgkv8g]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">CASE</span> nIndex == DBOI_SCOPETOP<br /><br /> <span style="color: #00C800;">IF</span> y > <span style="color: #000000;">0</span><br /> aOrderInfo<span style="color: #000000;">[</span> UR_ORI_RESULT <span style="color: #000000;">]</span> := aWAData<span style="color: #000000;">[</span> WA_SCOPETOP <span style="color: #000000;">]</span><span style="color: #000000;">[</span>y<span style="color: #000000;">]</span> <span style="color: #B900B9;">//RETURN ACTUALSCOPE TOP</span><br /> aWAData<span style="color: #000000;">[</span> WA_SCOPETOP <span style="color: #000000;">]</span><span style="color: #000000;">[</span>y<span style="color: #000000;">]</span> := aOrderInfo<span style="color: #000000;">[</span> UR_ORI_NEWVAL <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPEBOT <span style="color: #000000;">]</span><span style="color: #000000;">)</span> < y<br /> AADD<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPEBOT <span style="color: #000000;">]</span>,SPACE<span style="color: #000000;">(</span>LEN<span style="color: #000000;">(</span>CVALTOCHAR<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPETOP <span style="color: #000000;">]</span><span style="color: #000000;">[</span>y<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//THERE INST STILL A SCOPEBOT ARRAYS MUST HAVE SAME LEN</span><br /> <span style="color: #00C800;">ENDIF</span> <br /> <span style="color: #00C800;">ELSE</span><br /> AADD<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPETOP <span style="color: #000000;">]</span>,aOrderInfo<span style="color: #000000;">[</span> UR_ORI_NEWVAL <span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//AADD(aWAData[ WA_SCOPEBOT ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPETOP ][1])))) //THERE INST STILL A SCOPEBOT ARRAYS MUST HAVE SAME LEN</span><br /> aOrderInfo<span style="color: #000000;">[</span> UR_ORI_RESULT <span style="color: #000000;">]</span> := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">ENDIF</span> <br /> <br /> <span style="color: #00C800;">CASE</span> nIndex == DBOI_SCOPEBOTTOM<br /><br /> <span style="color: #00C800;">IF</span> y > <span style="color: #000000;">0</span><br /> aOrderInfo<span style="color: #000000;">[</span> UR_ORI_RESULT <span style="color: #000000;">]</span> := aWAData<span style="color: #000000;">[</span> WA_SCOPEBOT <span style="color: #000000;">]</span><span style="color: #000000;">[</span>y<span style="color: #000000;">]</span> <span style="color: #B900B9;">//RETURN ACTUALSCOPE TOP</span><br /> aWAData<span style="color: #000000;">[</span> WA_SCOPEBOT <span style="color: #000000;">]</span><span style="color: #000000;">[</span>y<span style="color: #000000;">]</span> := aOrderInfo<span style="color: #000000;">[</span> UR_ORI_NEWVAL <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPETOP <span style="color: #000000;">]</span><span style="color: #000000;">)</span> < y<br /> AADD<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPETOP <span style="color: #000000;">]</span>,SPACE<span style="color: #000000;">(</span>LEN<span style="color: #000000;">(</span>CVALTOCHAR<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPEBOT <span style="color: #000000;">]</span><span style="color: #000000;">[</span>y<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//THERE INST STILL A SCOPETOP ARRAYS MUST HAVE SAME LEN</span><br /> <span style="color: #00C800;">ENDIF</span> <br /> <span style="color: #00C800;">ELSE</span><br /> AADD<span style="color: #000000;">(</span> aWAData<span style="color: #000000;">[</span> WA_SCOPES <span style="color: #000000;">]</span>,aWAData<span style="color: #000000;">[</span> WA_INDEXACTIVE <span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aWAData<span style="color: #000000;">[</span> WA_SCOPEBOT <span style="color: #000000;">]</span>,aOrderInfo<span style="color: #000000;">[</span> UR_ORI_NEWVAL <span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//AADD(aWAData[ WA_SCOPETOP ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPEBOT ][1])))) //THERE INST STILL A SCOPETOP ARRAYS MUST HAVE SAME LEN</span><br /> aOrderInfo<span style="color: #000000;">[</span> UR_ORI_RESULT <span style="color: #000000;">]</span> := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">ENDIF</span> <br /><br /> </div>[/code:lglgkv8g]
|
ADO RDD xHarbour
|
Lucas,
Concerning dbcreate I think the default behavior of (x)Harbour is to override a table with the same name.
I think we should keep things as they are. I think our app is expecting this standard behavior.
User can test hb_adoRddExistsTable( oCn, cTable, cIndex ) before creating new table
Confirm?
|
ADO RDD xHarbour
|
Antonio,
As filters are not ready i cant work with the full app.
|
ADO RDD xHarbour
|
Lucas,
Ok Im looking now at filter and it seems easily adapted.
All other points are already corrected.
|
ADO RDD xHarbour
|
Antonio,
I also sent to your email a sample to test the Record is too large error.
Thanks.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.