| Hyderabad Jobs | Book Website | ![]() |
I Love Hyderabad | Hyderabad Colleges |
| Home | Business Emails | Hyderabad Classifieds | Contact Us | |
| 7 Wonders of Hyderabad | Web Hosting | Yellow Pages | Our Network | |
Advanced PowerBuilder
Data Retrieval CancellationIf you want to allow the user to stop retrieving data from the database, do you ask the user to press Escape key while data retrieval is in progress? No, that doesn't serve the purpose in this situation. First, you need to display a visual control such as a CommandButton (cb_cancel for example purpose), on the screen where (s)he can click on it to stop retrieval process. For the Clicked event of the CommandButton, you can write DBCancel() function to stop retrieving. DbCancel() cancels retrieving from the database. Once you issue Retrieve() function, DataWindow doesn't give the control back to the user till it completes retrieving. That means that if the user clicks on the cb_cancel button while the data is being retrieved, nothing will happen. There are couple of things you need to do to make it work. First, you need to set Asynchronous option on in the DbParam property in the transaction object. You should do this before your application connects to the database. Setting this option after connecting to the database doesn't have any effect. Then you need to write some code in the DataWindow's RetrieveRow event. Even if you a put a single comment will serve the purpose. The point here is that, PowerBuilder yields after retrieving each row when it sees some code in RetrieveRow event. Because of that yielding, user should be able to click on the cb_cancel while data is being retrieved. You need to declare an instance boolean variable and set it to true in the cb_cancel's Clicked event. In the RetrieveRow event, return 1 if that instance variable is set to true.
|
| Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com |