ADO RDD xHarbour

User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

Antonio, i want have this additional! to the size of records!
ex.

Code: Select all

SET ADO PRE OPEN THRESHOLD TO 10000 [MASK "2015","2014"]
Another thing for practice:
If the database cannot opened for now the app quits. But the developer will do in most cases another end of the app. (Writing a log or so,...).
My proposal: Add clausula [ON ERROR <functionslist>]

Code: Select all

SET ADO DEFAULT DATABASE TO <cDB> SERVER TO <cServer> ENGINE TO <cEngine> [USER TO <cUser>]  [PASSWORD TO <cPass>] [CLASSNAME <cClass>] ;
[ON ERROR <functionslist>]
Regards,
Günther
---------------------------------
office@byte-one.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Gunther,

It seems quite a good idea. Lets do it!

How shall we do it ?
I assume your idea is nrecords .OR. mask ?

Concerning ON ERROR cant this be done by the user defining a EXIT PROCEDURE instead?

in ADOGETCONNECT instead of QUIT I could make RETURN .F..
This only happens in app startup with SET ADO DATABASE TO....
Regards
Antonio H Ferreira
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

Antonio,
I assume your idea is nrecords .OR. mask ?
No, my idea is nrecords .AND. mask ? ex. In a app every year are building a new table with table"year" and becomes the focus. Older tables are not to preopen!
Concerning ON ERROR cant this be done by the user defining a EXIT PROCEDURE instead?
Not so good!? Maybe the programmer will not end the app. Instead of QUIT should in case of ON ERROR function(s) defined, these functions are to perform.
Regards,
Günther
---------------------------------
office@byte-one.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Gunther,
No, my idea is nrecords .AND. mask ? ex. In a app every year are building a new table with table"year" and becomes the focus. Older tables are not to preopen!
Ok I see it you don't want to preopen table of previous years. Ill do it.
Not so good!? Maybe the programmer will not end the app. Instead of QUIT should in case of ON ERROR function(s) defined, these functions are to perform.
I see it but then I would be more comfortable to throw an error and let the programmer take care of it which is the standard procedure. In fact there are some situations where this happens:

Other application not working with delete flag recno deletes (removes) that record from the table.
Field recno or field deleted dont exist on a table.
Lock control share path doesnt exits.

How do you do it today with dbf kind of rdd ? Isn't like this? We should respect standard procedures as much as we can. Wont you agree?
Regards
Antonio H Ferreira
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

Antonio,
How do you do it today with dbf kind of rdd ?
I check on start the present of all DBs and indexes. For this i hold ALL DB- and Indexnames and also the index-keys in a public array. Now it is easy to check and to organize.
Also for the update to ADORDD i can easy build the array for ListDbfIndex() from this public array.
Regards,
Günther
---------------------------------
office@byte-one.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Gunther,
I see it but then I would be more comfortable to throw an error and let the programmer take care of it which is the standard procedure.
Ok?
Regards
Antonio H Ferreira
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

OK, Antonio! :D
Regards,
Günther
---------------------------------
office@byte-one.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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

Corrected bugs:

DBCREATE if table exists just overwrite it like in any other rdd. It was giving a error.

hb_AdoRddFile( cFile ) if rddsetdefault == "adordd" it test if file exist in DB
otherwise it passes to normal FILE() function.So you can use it for all cases with or without adordd.

When SET ADO DATABASE TO... cant open connection instead of quiting app it throw error 10500.

Changes:

SET ADO PRE OPEN THRESHOLD TO <nRecords> [ MASK <aMask> ]
Added new option MASK that allow to pre open recordsets containing nrecords and with value MASK in table name.
Regards
Antonio H Ferreira
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

Antonio, should we not close the connection to the server automatically?
Regards,
Günther
---------------------------------
office@byte-one.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Gunther,

It should be closed auto by adordd.

When you end your app (x)Harbour auto calls ADO_EXIT that calls ADODB_CLOSE().
This last closes all tables (recordsets) and cached resordsets and after the connection to the server.

Please check the code.
Is it not working?
Regards
Antonio H Ferreira
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

It seems, this ADO_EXIT never is called! (EXIT PROCEDURE?)
Regards,
Günther
---------------------------------
office@byte-one.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Gunther,

Here it always gets called!

I don't have any exit procedure.

Placing msginfo("ADO_EXIT "+PROCNAME(1) +" "+ PROCNAME(2)+" "+ PROCNAME(3)+" "+ PROCNAME(4)) in ado_exit It shows that gets called from _QUIT.
Regards
Antonio H Ferreira
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

Antonio, no msginfo-text showing!
Regards,
Günther
---------------------------------
office@byte-one.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Gunther,

How do you exit you app QUIT or simply RETURN ?

Are you using Harbour or xHarbour?

Im using xHabour and app is QUIT.
Regards
Antonio H Ferreira
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: ADO RDD xHarbour

Post by byte-one »

Antonio, i found in the meanwhile that when i use quit the massage is showing, but when i close the main window (FIVEWIN) the quit is not called!
Regards,
Günther
---------------------------------
office@byte-one.com
Post Reply