?
Solved

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

Posted on 2003-03-18
5
Medium Priority
?
336 Views
Last Modified: 2013-12-26
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
Comment
Question by:dk_akj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
buasuwan earned 750 total points
ID: 8158023
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
 
LVL 2

Expert Comment

by:bluecomet
ID: 8158170
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
 

Author Comment

by:dk_akj
ID: 8158601
buasuwan >> Thanx i had already tried that but with return 0 instead of return 1 DOOH

Thanx
dk_akj
0
 
LVL 5

Expert Comment

by:buasuwan
ID: 8159452
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
 

Author Comment

by:dk_akj
ID: 8164511
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question