Page 1 of 1

Disable Advantage error message dialogs

PostPosted: Tue Nov 14, 2017 4:44 pm
by Massimo Linossi
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

Re: Disable Advantage error message dialogs

PostPosted: Tue Nov 14, 2017 7:06 pm
by Rick Lipkin
Massimo

You can always surround your execution statements with

Try

Catch
End Try

Code: Select all  Expand view


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

Re: Disable Advantage error message dialogs

PostPosted: Thu Nov 16, 2017 8:47 am
by Massimo Linossi
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

Re: Disable Advantage error message dialogs

PostPosted: Thu Nov 16, 2017 9:19 am
by Enrico Maria Giordano
If there is a way, you have to search for it through the ADS parameters.

EMG

Re: Disable Advantage error message dialogs

PostPosted: Thu Nov 16, 2017 9:29 am
by Massimo Linossi
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

Re: Disable Advantage error message dialogs

PostPosted: Thu Nov 16, 2017 2:16 pm
by Rick Lipkin
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

Re: Disable Advantage error message dialogs

PostPosted: Fri Nov 17, 2017 2:12 am
by Giovany Vecchi
If using Remote Ads, open the Advantage configuration Utility, select CONFIGURATION UTILITY > MISC SETTINGS tab and check SUPPESS MESSAGE BOXES

Re: Disable Advantage error message dialogs

PostPosted: Fri Nov 17, 2017 9:02 am
by Massimo Linossi
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

Re: Disable Advantage error message dialogs

PostPosted: Wed Dec 13, 2017 7:47 am
by Massimo Linossi
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

Re: Disable Advantage error message dialogs

PostPosted: Thu Dec 14, 2017 8:36 am
by toninhofwi
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.

Re: Disable Advantage error message dialogs

PostPosted: Thu Dec 14, 2017 8:56 am
by Massimo Linossi
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

Re: Disable Advantage error message dialogs

PostPosted: Thu Dec 14, 2017 11:14 pm
by toninhofwi
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

Re: Disable Advantage error message dialogs

PostPosted: Fri Dec 15, 2017 7:44 am
by Massimo Linossi
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