Page 67 of 70

Re: ADO RDD xHarbour

PostPosted: Mon Nov 16, 2015 10:24 am
by byte-one
Antonio, i want have this additional! to the size of records!
ex.
Code: Select all  Expand view
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  Expand view
SET ADO DEFAULT DATABASE TO <cDB> SERVER TO <cServer> ENGINE TO <cEngine> [USER TO <cUser>]  [PASSWORD TO <cPass>] [CLASSNAME <cClass>] ;
[ON ERROR <functionslist>]

Re: ADO RDD xHarbour

PostPosted: Mon Nov 16, 2015 10:43 am
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....

Re: ADO RDD xHarbour

PostPosted: Mon Nov 16, 2015 11:30 am
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.

Re: ADO RDD xHarbour

PostPosted: Mon Nov 16, 2015 11:58 am
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?

Re: ADO RDD xHarbour

PostPosted: Mon Nov 16, 2015 12:40 pm
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.

Re: ADO RDD xHarbour

PostPosted: Mon Nov 16, 2015 1:00 pm
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?

Re: ADO RDD xHarbour

PostPosted: Mon Nov 16, 2015 2:04 pm
by byte-one
OK, Antonio! :D

Re: ADO RDD xHarbour

PostPosted: Mon Nov 16, 2015 2:59 pm
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.

Re: ADO RDD xHarbour

PostPosted: Wed Nov 18, 2015 9:20 am
by byte-one
Antonio, should we not close the connection to the server automatically?

Re: ADO RDD xHarbour

PostPosted: Wed Nov 18, 2015 10:06 am
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?

Re: ADO RDD xHarbour

PostPosted: Wed Nov 18, 2015 10:14 am
by byte-one
It seems, this ADO_EXIT never is called! (EXIT PROCEDURE?)

Re: ADO RDD xHarbour

PostPosted: Wed Nov 18, 2015 10:31 am
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.

Re: ADO RDD xHarbour

PostPosted: Wed Nov 18, 2015 10:35 am
by byte-one
Antonio, no msginfo-text showing!

Re: ADO RDD xHarbour

PostPosted: Wed Nov 18, 2015 10:41 am
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.

Re: ADO RDD xHarbour

PostPosted: Wed Nov 18, 2015 10:49 am
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!