Skip to Content
Former Member
Sep 15, 2014 at 09:08 PM

How to auto reconnect to database after network disconnect?


Hey guys I am fairly new to Powerbuilder, I am trying to add database reconnect functionality to a application, but the application always fatal crashes after returning from the DBError event.

Flow of Events from Debugger:

** Get to breakpoint on Retrieve() statement **

** Manually disconnect network connection **


uo_transaction - SqlPreview()

uo_transaction - SqlPreview()

** General Network Error messagebox pops up **

uo_transaction - DBError() {

if code = 11 then


this.test_sql() // function that runs simple SQL to test database connection

if this.SQLCode < 0 then


DISCONNECT using this;

CONNECT using this;

end if

loop while this.SQLCode < 0

end if

return code


** Manually reconnect network connection, DBError returns **

uo_transaction - SqlPreview()

** Application fatally crashes - "Sybase Powerbuilder 12.5 has stopped working"**

Any help or suggestions?


How can I tell if I need to do a of_SetTransObject after database disconnect? - Google Groups

Database Connection - Google Groups

DBError - SyBooks Online