FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO RDD xHarbour
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Mon Nov 16, 2015 10:43 AM

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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Mon Nov 16, 2015 11:30 AM
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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Mon Nov 16, 2015 11:58 AM
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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Mon Nov 16, 2015 12:40 PM
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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Mon Nov 16, 2015 01:00 PM
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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Mon Nov 16, 2015 02:04 PM

OK, Antonio! :D

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Mon Nov 16, 2015 02:59 PM

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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Wed Nov 18, 2015 09:20 AM

Antonio, should we not close the connection to the server automatically?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Wed Nov 18, 2015 10:06 AM

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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Wed Nov 18, 2015 10:14 AM

It seems, this ADO_EXIT never is called! (EXIT PROCEDURE?)

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Wed Nov 18, 2015 10:31 AM

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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Wed Nov 18, 2015 10:35 AM

Antonio, no msginfo-text showing!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Wed Nov 18, 2015 10:41 AM

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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: ADO RDD xHarbour
Posted: Wed Nov 18, 2015 10:49 AM

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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Re: ADO RDD xHarbour
Posted: Wed Nov 18, 2015 11:10 AM

Gunther,

Im trying with

ACTIVATE WINDOW oWnd VALID ;
FimPrograma(ownd,oTimer)

The FimPrograma does not quit and even so the message is shown only ADO_EXIT but without any procs.

Regards

Antonio H Ferreira