Gunther,
If you need you can call directly ADODB_CLOSE() in order to close all tables, sets and connection thats what ADO_EXIT does.
I though ADO_EXIT would be called in any circumstance besides errors.
Antonio H Ferreira
Gunther,
If you need you can call directly ADODB_CLOSE() in order to close all tables, sets and connection thats what ADO_EXIT does.
I though ADO_EXIT would be called in any circumstance besides errors.
Antonio, for now i insert ADODB_CLOSE() in the valid from my main-window.
Another points to discuss i found on transfer my app to adordd is:
1.) If i fill the index-array the order cannot changing with SET INDEX TO .... In some cases this is required if i will not change the code.
2.) Opening the same DBF with 2 or more USE and different aliases is in other RDD possible. In ADORDD?
1.) If i fill the index-array the order cannot changing with SET INDEX TO .... In some cases this is required if i will not change the code.
2.) Opening the same DBF with 2 or more USE and different aliases is in other RDD possible. In ADORDD?
FUNCTION expalias()
LOCAL cerrorlog := "",n,j,ntarget,x
for n = 1 to 255
if ! Empty( Alias( n ) )
cErrorLog += CRLF + Str( n, 3 ) + ": " + If( Select() == n,"=> ", " " ) + ;
PadR( Alias( n ), 15 ) + Space( 20 ) + "NomeRDD: " + ;
( Alias( n ) )->( RddName() ) + CRLF
cErrorLog += " ==============================" + CRLF
cErrorLog += " RecNo RecCount BOF EOF" + CRLF
cErrorLog += " " + Transform( ( Alias( n ) )->( RecNo() ), "99999" ) + ;
" " + Transform( ( Alias( n ) )->( RecCount() ), "99999" ) + ;
" " + cValToChar( ( Alias( n ) )->( BoF() ) ) + ;
" " + cValToChar( ( Alias( n ) )->( EoF() ) ) + CRLF + CRLF
cErrorLog += " Used indexes " + Space( 23 ) + "TagName" + CRLF
for j = 1 to 15
if ! Empty( ( Alias( n ) )->( IndexKey( j ) ) )
cErrorLog += Space( 8 ) + ;
If( ( Alias( n ) )->( IndexOrd() ) == j, "=> ", " " ) + ;
PadR( ( Alias( n ) )->( IndexKey( j ) ), 35 ) + ;
( Alias( n ) )->( OrdName( j ) ) + ;
CRLF
endif
next
cErrorLog += CRLF + " Relações em uso " + CRLF
for j = 1 to 8
if ! Empty( ( nTarget := ( Alias( n ) )->( DbRSelect( j ) ) ) )
cErrorLog += Space( 8 ) + Str( j ) + ": " + ;
"TO " + ( Alias( n ) )->( DbRelation( j ) ) + ;
" INTO " + Alias( nTarget ) + CRLF
// uValue = ( Alias( n ) )->( DbRelation( j ) )
// cErrorLog += cValToChar( &( uValue ) ) + CRLF
endif
next
x := (alias(n))->(dbrlocklist())
cErrorLog += Space( 8 ) +"Locked records "+CRLF
for j = 1 to len(x)
cErrorLog += Space( 8 ) + "Recno "+str(x[j])+CRLF
next
endif
next
SHOWMEMO(cerrorlog)
RETURN .t.You write in a message before that this array are always on first ranking and after this the indexes with INDEX ON... added.
Gunther,
Is the problem solved ?
Im looking into indexes with SQLite right now so if you need something please let me know.
Antonio, i test now my app and have wrote a little testprogram. I send you tomorrow the results!
Greetings from Austria!
Antonio, after testing i can say: All is right!
Suggestions:
For the local (.ctl, files with text "nada") files you should also set a path ex.: <app>\adordd or the temp from windows as we should not write into the app-path (and/or a SET order)!
The text "nada" should more international.
SET ADO INDEX UDFS TO should contain for standard SUBS and SUBSTR.
Antonio, after testing i can say: All is right!
For the local (.ctl, files with text "nada") files you should also set a path ex.: <app>\adordd or the temp from windows as we should not write into the app-path (and/or a SET order)!
The text "nada" should more international.
SET ADO INDEX UDFS TO should contain for standard SUBS and SUBSTR.
In principle should be present here all ones that are not only to convert data types, such as SUBSTR for ex.
The ones that alter the value, length of a field must be present here.
Gunther,
We normally use index functions to convert all index keys to the same data type.
INDEX ON STR(NUM)+DTOS(DATE)+CVALTCHAR(LOGIC)
These kind of functions dont alter the data itself but only the type in order that can be evaluated without errors.
These kind of functions you dont need and should not use them in ADO UDF.
But for instances if we do instead
INDEX ON STR(NUM)+DTOS(DATE)+IF( LOGIC , "yes", "no")
Then we need to include in ADO UDF - IF to tell adordd that this index its a different one.
The same with UPPER, SUBSTR, ==, PAD, etc.
But you should only place them in ADO UDF if in fact they are used in your app in index expressions otherwise you dont need to take the time to do it.
Besides these you need there all true User Defined Functions.
Please note that if you place DTOS in ADO UDF all indexes with that function will be created in an array and after sorted. This array of bookmarks its then set in ado :filter method.
This is expensive to create and maintained in big tables and should be only used when truly needed.
Is this clear to you?
New build adordd ver 1.0 at https://github.com/AHFERREIRA/adordd.git
Corrected bugs:
APPEND with SQLITE, FIREBIRD, POSTGRE and ORACLE with index with UDF or condition was
adding the same bookmark twice.
ADO_REQUERY could fall into recursive calls after append new record using engines
Sqlite, FireBird Postgre and Oracle.
DBGOTO was giving error if the record was not within INDEX with UDF or condition.
Changes:
hb_AdoRddFile( cFile ) Check for index file in the adodbf index list... and support for Sqlite, Firebird, Oracle.
New build adordd ver 1.0 at https://github.com/AHFERREIRA/adordd.git
Corrected Bugs:
1) FIELDNAME was not returning upper fieldname in case of db engine PostGre, Oracle
2) Some upper case conversions to take care of lower case fields used by PostGre and Oracle.
3) Reserved keywords used in fields taken care with PostGre and Oracle.
4) SET TRESHOLD was not finding aMask if used table and SQL were with different case. Now all upper case.
5) Pre opening of recorsets optimized and cached for different where clauses on same table.
If the table its below the SET THRESHOLD and its already opened in another work area the set its not created again but cloned from that work area.
If during app run time a table passes the SET THRESHOLD value its cached next time is opened.
Tested engines:
ACCESS
ADS
DBASE
FIREBIRD
FOXPRO
MS SQL
MYSQL
POSTGRE
SQLITE
Still not tested but should work ok:
ANYWHERE
INFORMIX
MARIADB
ORACLE
Antonio, line 6233 lReval -> lRetval