Disable Advantage error message dialogs

Disable Advantage error message dialogs

Postby Massimo Linossi » Tue Nov 14, 2017 4: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Disable Advantage error message dialogs

Postby Rick Lipkin » Tue Nov 14, 2017 7:06 pm

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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Disable Advantage error message dialogs

Postby Massimo Linossi » Thu Nov 16, 2017 8: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Disable Advantage error message dialogs

Postby Enrico Maria Giordano » Thu Nov 16, 2017 9:19 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Disable Advantage error message dialogs

Postby Massimo Linossi » Thu Nov 16, 2017 9: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Disable Advantage error message dialogs

Postby Rick Lipkin » Thu Nov 16, 2017 2: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Disable Advantage error message dialogs

Postby Giovany Vecchi » Fri Nov 17, 2017 2:12 am

If using Remote Ads, open the Advantage configuration Utility, select CONFIGURATION UTILITY > MISC SETTINGS tab and check SUPPESS MESSAGE BOXES
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: Disable Advantage error message dialogs

Postby Massimo Linossi » Fri Nov 17, 2017 9: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Disable Advantage error message dialogs

Postby Massimo Linossi » Wed Dec 13, 2017 7: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Disable Advantage error message dialogs

Postby toninhofwi » Thu Dec 14, 2017 8: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.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Disable Advantage error message dialogs

Postby Massimo Linossi » Thu Dec 14, 2017 8: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Disable Advantage error message dialogs

Postby toninhofwi » 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
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Disable Advantage error message dialogs

Postby Massimo Linossi » Fri Dec 15, 2017 7: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests