ADO RDD xHarbour
Re: ADO RDD xHarbour
Antonio, there are still warnings on compiling! You should use es2 as errorlevel in compiler.
Compiling 'C:\adordd\adordd.prg'...
C:\adordd\adordd.prg(486) Warning W0001 Ambiguous reference: 'OCATALOG'
C:\adordd\adordd.prg(487) Warning W0001 Ambiguous reference: 'OCATALOG'
C:\adordd\adordd.prg(1906) Warning W0001 Ambiguous reference: 'XVALUE'
C:\adordd\adordd.prg(1922) Warning W0001 Ambiguous reference: 'XVALUE'
C:\adordd\adordd.prg(5722) Warning W0001 Redefinition or duplicate definition of #define DBS_NAME
C:\adordd\adordd.prg(5723) Warning W0001 Redefinition or duplicate definition of #define DBS_TYPE
C:\adordd\adordd.prg(5724) Warning W0001 Redefinition or duplicate definition of #define DBS_LEN
C:\adordd\adordd.prg(5725) Warning W0001 Redefinition or duplicate definition of #define DBS_DEC
C:\adordd\adordd.prg(5757) Warning W0005 RETURN statement with no return value in function
Also this function is missing: waiton( " Subdir......"+ cFile)
Compiling 'C:\adordd\adordd.prg'...
C:\adordd\adordd.prg(486) Warning W0001 Ambiguous reference: 'OCATALOG'
C:\adordd\adordd.prg(487) Warning W0001 Ambiguous reference: 'OCATALOG'
C:\adordd\adordd.prg(1906) Warning W0001 Ambiguous reference: 'XVALUE'
C:\adordd\adordd.prg(1922) Warning W0001 Ambiguous reference: 'XVALUE'
C:\adordd\adordd.prg(5722) Warning W0001 Redefinition or duplicate definition of #define DBS_NAME
C:\adordd\adordd.prg(5723) Warning W0001 Redefinition or duplicate definition of #define DBS_TYPE
C:\adordd\adordd.prg(5724) Warning W0001 Redefinition or duplicate definition of #define DBS_LEN
C:\adordd\adordd.prg(5725) Warning W0001 Redefinition or duplicate definition of #define DBS_DEC
C:\adordd\adordd.prg(5757) Warning W0005 RETURN statement with no return value in function
Also this function is missing: waiton( " Subdir......"+ cFile)
Re: ADO RDD xHarbour
Gunther,
I dont know why didnt get those errors.
Its corrected for next posted version.
Meanwhile please alter in adordd.prg :
C:\adordd\adordd.prg(1906) Warning W0001 Ambiguous reference: 'XVALUE' with cFieldName
C:\adordd\adordd.prg(1922) Warning W0001 Ambiguous reference: 'XVALUE' with uInfo
C:\adordd\adordd.prg(5757) Warning W0005 RETURN statement with no return value in function RETURN NIL
You can delete these:
C:\adordd\adordd.prg(5722) Warning W0001 Redefinition or duplicate definition of #define DBS_NAME
C:\adordd\adordd.prg(5723) Warning W0001 Redefinition or duplicate definition of #define DBS_TYPE
C:\adordd\adordd.prg(5724) Warning W0001 Redefinition or duplicate definition of #define DBS_LEN
C:\adordd\adordd.prg(5725) Warning W0001 Redefinition or duplicate definition of #define DBS_DEC
waiton( " Subdir......"+ cFile)
Thanks
I dont know why didnt get those errors.
Its corrected for next posted version.
Meanwhile please alter in adordd.prg :
C:\adordd\adordd.prg(1906) Warning W0001 Ambiguous reference: 'XVALUE' with cFieldName
C:\adordd\adordd.prg(1922) Warning W0001 Ambiguous reference: 'XVALUE' with uInfo
C:\adordd\adordd.prg(5757) Warning W0005 RETURN statement with no return value in function RETURN NIL
You can delete these:
C:\adordd\adordd.prg(5722) Warning W0001 Redefinition or duplicate definition of #define DBS_NAME
C:\adordd\adordd.prg(5723) Warning W0001 Redefinition or duplicate definition of #define DBS_TYPE
C:\adordd\adordd.prg(5724) Warning W0001 Redefinition or duplicate definition of #define DBS_LEN
C:\adordd\adordd.prg(5725) Warning W0001 Redefinition or duplicate definition of #define DBS_DEC
waiton( " Subdir......"+ cFile)
Thanks
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
adordd finished version at https://github.com/AHFERREIRA/adordd.git
adordd is finished!
I don't have plans to add any new functionalities to it.
Its now working just like any other kind dbfcdx rdd and it allows you to port your app in minutes (time to load tables) to any SQL.
From now on Ill only post new versions to correct bugs.
All your comments, experiences, ideas and bug reports are most welcomed!
New features:
1) ADO_EXIT called internally to close all tables and connections whe exit the app.
2) Gave up the idea of persistent recordsets to open huge sets because the difference speed in opening
its completely lost closing it( saving it) instead I ve made a new set.
SET ADO CACHESIZE TO 100 ASYNC ON ASYNCNOWAIT ON
This set has huge impact on performance opening huge tables.
Playing with this set might improve significantly the opening time but then you might not have all rows available immediately.
You have to test yourself if your app works ok with the different options.
adordd main problem is opening huge tables without any where clause causing it to load all rows.
This brings problems with loading time and memory consumption.
On the other hand please remember that this would be the slowest loading time of a table no matter if you have
1 or 200 users opposite to dbfcdx kind of rdds.
This is not a standard practice in SQL but to keep backwards compatibility with our apps we need to do it
like this.
In apps where there aren't any historic files and all data is kept in the working tables the only alternative is either to pass old data to historic files or use USE ctable WHERE where clause.
If you cannot do any of these and you have huge tables adordd might not be for you and in these cases the only alternative to go to SQL is ADS as far as I know (keeping almost same app code ).
The only workaround for this limitation is to build a class accessing the SQL through C interface (HDO from Exposito for ex).
adordd can work with any other class as long as the few methods and data adordd use from MS ADO are
replicated in that class.
This class could build the sets in a local dbf files, arrays etc.
adordd is finished!
I don't have plans to add any new functionalities to it.
Its now working just like any other kind dbfcdx rdd and it allows you to port your app in minutes (time to load tables) to any SQL.
From now on Ill only post new versions to correct bugs.
All your comments, experiences, ideas and bug reports are most welcomed!
New features:
1) ADO_EXIT called internally to close all tables and connections whe exit the app.
2) Gave up the idea of persistent recordsets to open huge sets because the difference speed in opening
its completely lost closing it( saving it) instead I ve made a new set.
SET ADO CACHESIZE TO 100 ASYNC ON ASYNCNOWAIT ON
This set has huge impact on performance opening huge tables.
Playing with this set might improve significantly the opening time but then you might not have all rows available immediately.
You have to test yourself if your app works ok with the different options.
adordd main problem is opening huge tables without any where clause causing it to load all rows.
This brings problems with loading time and memory consumption.
On the other hand please remember that this would be the slowest loading time of a table no matter if you have
1 or 200 users opposite to dbfcdx kind of rdds.
This is not a standard practice in SQL but to keep backwards compatibility with our apps we need to do it
like this.
In apps where there aren't any historic files and all data is kept in the working tables the only alternative is either to pass old data to historic files or use USE ctable WHERE where clause.
If you cannot do any of these and you have huge tables adordd might not be for you and in these cases the only alternative to go to SQL is ADS as far as I know (keeping almost same app code ).
The only workaround for this limitation is to build a class accessing the SQL through C interface (HDO from Exposito for ex).
adordd can work with any other class as long as the few methods and data adordd use from MS ADO are
replicated in that class.
This class could build the sets in a local dbf files, arrays etc.
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
Antonio,
First of all congratulations for this huge job! I'm going to test it ASAP. Just a question: Is there any working example showing all (or most of all) features of your rdd?
TIA,
First of all congratulations for this huge job! I'm going to test it ASAP. Just a question: Is there any working example showing all (or most of all) features of your rdd?
TIA,
Kleyber Derick
FWH / xHb / xDevStudio / SQLLIB
FWH / xHb / xDevStudio / SQLLIB
Re: ADO RDD xHarbour
Kleyber,
Thanks.
You have tryadordd but be advise that I didnt test it myself with these last versions, but should be a good guide.
There arent any special features to show, it works just like dbcdx kind rdd.
The best way to test it is to upload your tables compile and link adordd and run it.
Please read 01_readme.pdf you have it all there.
Thanks.
You have tryadordd but be advise that I didnt test it myself with these last versions, but should be a good guide.
There arent any special features to show, it works just like dbcdx kind rdd.
The best way to test it is to upload your tables compile and link adordd and run it.
Please read 01_readme.pdf you have it all there.
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
Thank you for your effort Antonio,
I'll try it also as soon as possible.
I'll try it also as soon as possible.
Regards,
Hakan ONEMLI
Harbour & VS 2019 & FWH 20.12
Hakan ONEMLI
Harbour & VS 2019 & FWH 20.12
Re: ADO RDD xHarbour
Antonio, this error comes on different places in the code of adordd.prg. I tested with access and mssql.
Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: OPEN
Args:
[ 1] = C SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'adisc' AND TABLE_NAME = 'TABLE1'
[ 2] = O ADODB.Connection
Stack Calls
===========
Called from: => TOLEAUTO:OPEN( 0 )
Called from: C:\adordd\adordd.prg => ADORECCOUNT( 806 )
Called from: C:\adordd\adordd.prg => ADO_REFRESH( 823 )
Called from: C:\adordd\adordd.prg => ADO_GOTOP( 989 )
Called from: C:\adordd\adordd.prg => ADO_OPEN( 381 )
Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: OPEN
Args:
[ 1] = C SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'adisc' AND TABLE_NAME = 'TABLE1'
[ 2] = O ADODB.Connection
Stack Calls
===========
Called from: => TOLEAUTO:OPEN( 0 )
Called from: C:\adordd\adordd.prg => ADORECCOUNT( 806 )
Called from: C:\adordd\adordd.prg => ADO_REFRESH( 823 )
Called from: C:\adordd\adordd.prg => ADO_GOTOP( 989 )
Called from: C:\adordd\adordd.prg => ADO_OPEN( 381 )
Re: ADO RDD xHarbour
Gunther,
This routine returns the lastrec().
With access it can not error that because with engine = ACCESS its SELECT MAX--- you can check the code.
As I informed previously I only tried it with Access but mainly with MySql.
I suspect that with MsSql the syntax of SELECT ... FROM SCHEMA... its wrong.
Do you know the correct one ?
Meantime if you want to try it replace in ADORECCOUNT
IF aAWData[ WA_ENGINE ] = "ACCESS" .OR. aAWData[ WA_ENGINE ] = "MSSQL"
Its slower but it should work.
This routine returns the lastrec().
With access it can not error that because with engine = ACCESS its SELECT MAX--- you can check the code.
As I informed previously I only tried it with Access but mainly with MySql.
I suspect that with MsSql the syntax of SELECT ... FROM SCHEMA... its wrong.
Do you know the correct one ?
Meantime if you want to try it replace in ADORECCOUNT
IF aAWData[ WA_ENGINE ] = "ACCESS" .OR. aAWData[ WA_ENGINE ] = "MSSQL"
Its slower but it should work.
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
Antonio, with Access i read this error:
Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: OPEN
Args:
[ 1] = C SELECT * FROM TABLE1 ORDER BY HBRECNO
[ 2] = O ADODB.Connection
[ 3] = N 2
[ 4] = N 3
[ 5] = N 0
Stack Calls
===========
Called from: => TOLEAUTO:OPEN( 0 )
Called from: C:\adordd\adordd.prg => ADO_OPEN( 318 )
In tryadordd.prg:should be:
should be:
Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: OPEN
Args:
[ 1] = C SELECT * FROM TABLE1 ORDER BY HBRECNO
[ 2] = O ADODB.Connection
[ 3] = N 2
[ 4] = N 3
[ 5] = N 0
Stack Calls
===========
Called from: => TOLEAUTO:OPEN( 0 )
Called from: C:\adordd\adordd.prg => ADO_OPEN( 318 )
In tryadordd.prg:
Code: Select all
SET ADO DEFAULT DATABASE TO "D:\WHATEVER\TESTADORDD.MDB" SERVER TO "ACESS" ENGINE TO ACCESS USER TO "" PASSWORD TO ""
Code: Select all
SET ADO DEFAULT DATABASE TO "D:\WHATEVER\TESTADORDD.MDB" SERVER TO "" ENGINE TO "ACCESS" USER TO "" PASSWORD TO ""
Code: Select all
MSGINFO("DOES TABLE1 EXISTS ON DB ?"+CVALTOCHAR(hb_adoRddExistsTable( "Table1") ))
MSGINFO("DOES TABLE3 EXISTS ON DB ?"+CVALTOCHAR(hb_adoRddExistsTable( "Table3") ))
Code: Select all
MSGINFO("DOES TABLE1 EXISTS ON DB ?"+CVALTOCHAR(hb_adoRddExistsTable( ,"Table1") ))
MSGINFO("DOES TABLE3 EXISTS ON DB ?"+CVALTOCHAR(hb_adoRddExistsTable(, "Table3") ))
Re: ADO RDD xHarbour
Antonio, i found the equivalent for MSSQL in function ADORECCOUNT(nWA,oRecordSet):
Code: Select all
IF aAWData[ WA_ENGINE ] = "ACCESS" //.or. aAWData[ WA_ENGINE ] = "MSSQL"//6.08.15 ONLY WITH ACCESSIT TAKES LONGER IN BIG TABLES
cSql := "SELECT MAX("+(ADO_GET_FIELD_RECNO( aAWData[WA_TABLENAME] ))+") FROM "+aAWData[WA_TABLENAME]
ELSEIF aAWData[ WA_ENGINE ] = "MSSQL"
cSql := "SELECT IDENT_CURRENT('"+aAWData[WA_TABLENAME]+"')+1 AS AUTO_INCREMENT"
ELSE
//30.06.15 REPLACED BY RAO NAGES IDEA next incremente key
cSql := "SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES"+;
" WHERE TABLE_SCHEMA = '"+aAWData[ WA_CATALOG ]+"' AND TABLE_NAME = '"+aAWData[ WA_TABLENAME ]+"'"
ENDIF
Re: ADO RDD xHarbour
Gunther,
Great!
In ACCESS its also needed
Is it working now with MSSQL?
Great!
In ACCESS its also needed
Code: Select all
cSql := "SELECT MAX("+(ADO_GET_FIELD_RECNO( aAWData[WA_TABLENAME] ))+")[b]+1[/b] FROM "+aAWData[WA_TABLENAME]
Regards
Antonio H Ferreira
Antonio H Ferreira
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: ADO RDD xHarbour
Gunther
I am just curious .. what are you trying to extract from the database .. a table structure, field attribute ?
Rick Lipkin
I am just curious .. what are you trying to extract from the database .. a table structure, field attribute ?
Rick Lipkin
Re: ADO RDD xHarbour
Antonio, Rick!
"SELECT IDENT_CURRENT('"+aAWData[WA_TABLENAME]+"')+1 AS AUTO_INCREMENT" i found in internet for MSSQL.
Antonio, there are a error with ACCESS!!!
"SELECT IDENT_CURRENT('"+aAWData[WA_TABLENAME]+"')+1 AS AUTO_INCREMENT" i found in internet for MSSQL.
Antonio, there are a error with ACCESS!!!
Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: OPEN
Args:
[ 1] = C SELECT * FROM TABLE1 ORDER BY HBRECNO
[ 2] = O ADODB.Connection
[ 3] = N 2
[ 4] = N 3
[ 5] = N 0
Stack Calls
===========
Called from: => TOLEAUTO:OPEN( 0 )
Called from: C:\adordd\adordd.prg => ADO_OPEN( 318 )
Re: ADO RDD xHarbour
Gunther,
Strange here its ok
Is the field HBRECNO in the table ?
What is your SET ADO CACHESIZE TO... ?
Strange here its ok
Is the field HBRECNO in the table ?
What is your SET ADO CACHESIZE TO... ?
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
Antonio, now i found that the .mdb is constructed but no tables inside!! -> Also the error comes from here.
I use this code:
ADO CACHESIZE i do not use!
I use this code:
Code: Select all
DbCreate("table1;"+cPath+"\test2.mdb", .....