FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Disable Advantage error message dialogs
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Disable Advantage error message dialogs
Posted: Tue Nov 14, 2017 04:44 PM

Hi to all.
Is there a way to disable the Advantage Database error message dialogs ?
Sometimes a batch procedure that runs during the night is giving some errors, and ADS opens a dialog with a button that
must be pressed otherwise the program stays stopped.
Another way could be to trap the ADS errors but I can't find documentation about this.
Thanks a lot
Massimo

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Disable Advantage error message dialogs
Posted: Tue Nov 14, 2017 07:06 PM
Massimo

You can always surround your execution statements with

Try

Catch
End Try

Code (fw): Select all Collapse
lOk := .t.

Try
   execute something     // if fails .. the error is routed to the Catch statement and you can recover from there
Catch
    lOk := .f.
End Try

If lOk = .f.       //  use this to recover and move on
   Select Database
   Skip
   loop
Endif


Rick Lipkin
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Disable Advantage error message dialogs
Posted: Thu Nov 16, 2017 08:47 AM

Hi Rick.
I've tried your suggestion but the problem is still here.
The ADS popup appears when there is an error and the program stops its execution until you press the OK button.
Even if you close the statement in the TRY-CATCH-END commands.
It's really strange that is not possible to trap the ADS errors inside your program.
Thanks a lot for your time
Massimo

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Disable Advantage error message dialogs
Posted: Thu Nov 16, 2017 09:19 AM

If there is a way, you have to search for it through the ADS parameters.

EMG

Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Disable Advantage error message dialogs
Posted: Thu Nov 16, 2017 09:29 AM

I'm looking for these parameters in some documentation but till now I didn't find something useful.
I go on with some research on other forums too.
Thanks a lot.
Massimo

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Disable Advantage error message dialogs
Posted: Thu Nov 16, 2017 02:16 PM

Massimo

Reinaldo Crespo is the ADS expert .. hopefully he will chime in here to give you a hand .. if not .. you can start a new thread to his attention.

Rick Lipkin

Posts: 244
Joined: Mon Jun 05, 2006 09:39 PM
Re: Disable Advantage error message dialogs
Posted: Fri Nov 17, 2017 02:12 AM
If using Remote Ads, open the Advantage configuration Utility, select CONFIGURATION UTILITY > MISC SETTINGS tab and check SUPPESS MESSAGE BOXES
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Disable Advantage error message dialogs
Posted: Fri Nov 17, 2017 09:02 AM

Hi.
I've tried your suggestion but the error messages inside a procedure are still there.
Maybe the messages that are disabled with that check are others.
It's a nightmare.
Thanks a lot
massimo

Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Disable Advantage error message dialogs
Posted: Wed Dec 13, 2017 07:47 AM

Hello again.
Reading inside the help of ADS, i found a please where is written that is possible to use a
custom error procedure inside your program, where Advantage is sending the error messages.
Someone has ever tried to make something like this ?
Thanks a lot
Massimo

Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Disable Advantage error message dialogs
Posted: Thu Dec 14, 2017 08:36 AM

Hi,

first of all: there are a picture of this error please?

second: I don´t know any ADS api that disable the errors, where you find it and what is the ADS version?

regards.

Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Disable Advantage error message dialogs
Posted: Thu Dec 14, 2017 08:56 AM

Hi.
I wish to disable any kind of errors, because it something happen during a bath processing
running in the night, the program stopped and the open tables are blocking the server automatic
backups.
I've seen this inside the help of the ADS 11.10

In most cases, run-time errors can be detected by your code. When an error is encountered, an error message is generated and passed to an error object in your CA-Visual Objects error handler or a screen will pop up with an error code.
If a run-time error occurs, identify the error class and specific message. Advantage will use the instance variable, "OSCode", in the CA-Visual Objects error object. You may see error codes in the OSCode field. Advantage error codes are listed in the Advantage Error Guide Help File.
CAUTION When opening a table, the error object is no longer populated if an error occurs. This is because the error object was triggering the default error handler to be called even if the error was handled within the application. This was implemented to provide the ability to control error handling without the resulting default message box being displayed.
The example code below can be used for determining if an error occurred while attempting to open a table:

LOCAL oDB AS DBServer
LOCAL dwError AS DWORD
LOCAL pacError AS PSZ
LOCAL wLen AS WORD
LOCAL lReturn AS LONGINT

pacError := MemAlloc( 200 )
wLen := 200
RDDSETDEFAULT("AXDBFCDX")
oDB := DBServer {"d:\demo10.dbf", DBShared,, "AXDBFCDX"}
lReturn := AdsGetLastError( @dwError, pacError, @wLen)
IF lReturn != AE_SUCCESS
ErrorBox{ , "Failed to get last error" }:Show()
ELSEIF dwError != AE_SUCCESS
ErrorBox{ , " Advantage error = " + pacError }:Show()
ENDIF

Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Disable Advantage error message dialogs
Posted: Thu Dec 14, 2017 11:14 PM
oDB := DBServer {"d:\demo10.dbf", DBShared,, "AXDBFCDX"}
lReturn := AdsGetLastError( @dwError, pacError, @wLen)


if !AdsConnect60( "C:\", 2 )

cMsg = Space( 300 )

adsGetLastError( @cMsg )

winMsgInfo( cMsg ), "Error connecting do C:\" )

endif
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Disable Advantage error message dialogs
Posted: Fri Dec 15, 2017 07:44 AM

Hi.
If there is an internal error on AdsConnect, you have a popup message made from the ADS client
with the error number and the description. And you must click on the OK button to close it.
So the program execution is stopped until you close the error message.
And this happens also when you use the AdsExecuteSQLDirect function.

Thanks a lot
Massimo

Continue the discussion