Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

How to avoid messagebox when dw.retrieve() and an error occours

Hi

I'm building a server application.

On a timer event i retrieve a datawindow (dw_jobs) if for some reason the DB i dead i get a messagebox: "Select error: Possible network error....."

I have build my own error handling and I don't want the messagebox to appear.

regards
dk_akj
0
dk_akj
Asked:
dk_akj
  • 2
  • 2
1 Solution
 
buasuwanCommented:
you can customize and display your error message for the datawindow control when error occurs.

you need to write codes in 'DBError' event of your datawindow 'dw_jobs'.

// sample code, Messagebox to user.

MessageBox("Error", sqlerrtext)
return 1  

// Or you can call your own error handling in this event.
// and return 1 to tell the powerbuilder to do not display system error message.


Regards,
0
 
bluecometCommented:
Just a hint,

i have herited a datawindow and declare a instance var for dberror. On Dberror event put i_dberror = sqldbcode and return 1. So every time you will have your db errors and do with them what you want.

$regards

0
 
dk_akjAuthor Commented:
buasuwan >> Thanx i had already tried that but with return 0 instead of return 1 DOOH

Thanx
dk_akj
0
 
buasuwanCommented:
from Powerbuilder Help,

DBError Event (Datawindows)

Return value

Set the return code to affect the outcome of the event:

0  Display the error message
1  Do not display the error message


? why return 0 ?
0
 
dk_akjAuthor Commented:
I don't know, i read the helpfile prior starting this thread but I guess i have read it to fast :-)
You know sometimes things are so simple it gets complicated.

//dk_akj
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now