Application: Client/Server Enviroment, Transact SQL
Application: Client/Server Enviroment, Transact SQL
1. What is a PowerBuilder Application? An application is a collection of PB windows that perform related business activity in the application. PowerBuider Application is an object-oriented, event-driven application that executes within windows, typically within client-server architecture. 2. What is the application object? It is the entry point into an organised collection of windows and controls that perform specific activities. An Open event for Application Object is Triggered. The script we write in this event initialises the activity in the application. 3. What is the purpose of the application object ? In PowerBuilder, we always develop in the context of an application. We associate other objects, such as windows, menus, etc., with the application. 4. What events do you know for the application object? OPEN - the user starts application. IDLE - no mouse or keyboard activity happens in a specified number of seconds SystemError - A serious error occurred during execution CLOSE - the user closes the application ConnectionBegin --in a distributed computing environment, occurs on the server when a client establishes a connection to the server by calling the ConnectToServer function. CONNECTIONEND -- In a distributed computing environment, occurs on the server when a client disconnects from the server by calling the DisconnectServer function. 5. What is a PBU ? PB uses PBU (unit) as a measurement tool. Using this unit we can build an application that looks similar on screens of different sizes
PowerBuilder Environment
6. What is PowerBuilder? PowerBuilder is a graphical PC-based client/server application development environment that helps you to develop a Windows application that accesses your server DB. 7. What is client/server environment? A client server environment allows several PCs (called client) to access one centralised database (or databases) on the centralised PC (server).
8. How could you describe CLIENT/SERVER ENVIROMENT? Client/server environment consists of 3 components: Client aspect that deals with user interface; Server aspect executes SQL statements and manages all access to the database; Client/server environment is a network. The network is an entity that connects the Client and Server functions. 9. Name at least 3 aspects of an application that are maintained through the Application painter: 1. application icon 2. default font characteristics 3. library search path 10. Briefly describe two ways of changing the current application. To change the current application, either: select (open) another existing application object create a new object. 11. What is a PainterBar ? A set of graphical tools within PB that we use to create PB objects. 12. What is a Library search path ? It is a sequence of one or more libraries in which PB will be able to find the objects used in the application. 13. How can you run another application from within PowerBuilder? We could do it using PB function Run( ). Run (string {, WindowState}), where string is a string whose value is the filename of the program we want to execute. Optionally, the string can contain one or more parameters of the program; WindowState (optional) is a value of the WindowState enumerated data type indicating the state in which we want to run the program. E.g., Run(c:\winword.exeleter.doc, Maximized!) 14. How do you know that the application is already running? (How do you avoid MessageBox Application is already running?) Use Handle( ) function. Handle( ) returns the objects name if the object exists. 15. What are the 2 objects every application has? An Application object and at least one window. 16. What are the two structures every application has? Every PowerBuilder application has the MessageObject and the ErrorObject. ErrorObject is used to report errors during execution. MessageObject--to process messages that are not PowerBuilder-defined events, and pass parameters between windows. 17. What is the Power bar?
The power bar is the main control point for building Powerbuilder applications. From the PowerBar you can open a PB painter, debug or run the current application, request help or customise PowerBuilder. 18. What common components do you know for all painters? Control menu, the Title bar, the menu bar. 19. What toolbars do you use in PowerBuilder? PowerBar - for opening painters and other tools. PainterBar - specific for each painter StyleBar - for changing attributes of text ColorBar- for changing colors 20. How can you customise PowerBar? Invoking pop-up menu by right clicking on the PowerBar and selecting Customise from the menu bar. 21. What are the ways to close your application? HALT(), HALT CLOSE(), CLOSE() 22.What is HALT? HALT CLOSE? What is the difference between them? The HALT statement forces the application to terminate immediately. This is most often used to shut down the application after a serious error occurred. HALT CLOSE Halt Close does the same thing but triggers the application objects Close event before terminating. 23. A Client/Server application must be GUItrue or false? 24. Client/Server means going away from mainframe or mini ????? 25. What do you do to find out how fast your select is being executed on a client site? Put TRACE option in the .INI file ( SQL_OPT_TRACEConnect Option DBParm parameter) Purpose - Turns on/off the ODBC Driver Manager Trace in PB to troubleshoot a connection to an ODBC data source. It provides detailed information about the ODBC API function calls made by PB when connected to an ODBC data source. Values - The values you can specify are: SQL_OPT_TRACE_OFF (Default) - Turns off the ODBC Driver Manager Trace. SQL_OPT_TRACE_ON - Turns on the ODBC Driver Manager Trace. 3. What are the ways to test correctness of your SQL? SQL Time? Put TRACE option in the .INI file.
12. What is .INI file and how do you use it? An .INI file is a text file, so you can read and modify it with any text editor, such as Notepad. PB.INI contains many parameters about your PB configuration. The PowerScript language has functions (e.g., ProfileString()), for reading and writing .INI file info. You might consider creating an .INI file for every application that you create. 13. How can you create .INI file? Short key is SHIFT F6. We name the source in the Text file through any file Editor. 14. How do you manipulate .INI file through PowerBuilder functions? Set Profile String( ) ProfileString( ) Profile Int( ) 20. How do you set calculator in PB application? Run (c:\ calculator )