PB Development Sybase Database Application Skills Drops Xiuhua 01-4-28 10:45:40
PowerBuilder (PB) is a cross-platform and powerful development tool. In the application mode of the client / server system structure, a wide range of applications as an object-oriented visual design tool for the client is a wide range of applications in systems connected to the database. In the process of developing Sybase database applications using PB, I have accumulated a little experience and skill in the process of establishing a corporate management information system, and some of them will be introduced here, and may be able to inspire and help from friends.
First, PowerBuilder and Sybase SQL Server connection
If there is a problem in the connection, you must think more. First check the client's situation, confirm that the Open Client is installed and configured correctly. Note that Open Client must be 32 bits of PowerBuilder, or is 16 bits.
The PB and Sybase can't connect, and there are several common mistakes and processing methods as follows:
1. The Sybase database is connected, but the user who has defined the user has defined in the PB database (Database) section.
At this point ISQL or Sybase Advantage can be opened, logged in to the "SA" database, execute the PBSyc.sql script file (the file is located in the server directory of the PB mounting disk). It is worth mentioning that pay attention to the version number of Sybase Adaptive Server and changes according to the relevant items of the information.
2. When opening a PB's project drawing board (PRORARY), an error message appears: "Cannot Locate Source Management DLL".
This problem is because when PB is installed, the interface of the installation version control software (such as PVCS) is selected, and the corresponding version control software is not installed on the machine's machine.
Workaround: In the PB setting, remove the interface of the version control software, the specific steps are, can be found in the [library] section in the Pb.ini file, and commented "Sourcevendor = ...".
3. Database connection is normal, but when you open a user table, if there is Chinese characters in the table, there is garbled.
This problem is usually because the client's default character set setting is inconsistent with the server-side character set setting, and the Locales.dat file (this file is located in the locales subdirectory of the Sybase installation directory). If you can modify the related content of [NT] section under the Windows95 / 98 operating system; if the operating system platform is Windows3.x, you will modify the contents of [Win3] section. In this section, there is a line of text to local = default, us_english, IS0_1, indicating that the client's default characters are set to ISO_1. Developing Chinese Management Information Systems Generally recommended to change the character set to CP85o, and you must do appropriate adjustments on the server side.
Second, PB programming a few skills
1. Implement the data column automatic folding in the Data Window (DataWindow).
One of the reasons why PB software is welcomed in the market is that its data window is very functional, and it is easy to apply.
When using DataWindow, the data that is often encountered is too long, and all situations cannot be displayed at the same time. If the automatic horizontal scroll is used, it is not easy to operate. There is a way to realize multi-line display (automatic folding). Specific steps are as follows:
1. Open this dataWindow in the DataWindow Panter, double-click the mouse on the column you want to set the auto fold, and bounce with this column. Point Position Tags, select the AutoSize Heigh Multiper; select the Edit label, do not select the Auto Horzscroll multi-select box; click the OK button to save the modifications. 2. Detail Band (ie
2. In the data window (DataWindow), use the Enter key to move between the fields.
The basic practice is: select the data window, define a user event, in the pop-up user event definition window, associate the Event ID with the PBM_DWnProcessenter, add the following two line statements in the script:
Send (Handle (THIS), 256, 9 long (0, 0)) (Messages that handle the TAB key to the system)
Return 1 (Ignore the default processing that the Enter key should be made)
3. Select the GRID data window mode to avoid the form line above the header.
You can implement a table format report output with a GRID data window, but do not control or handle it above the header, which will appear on the table lines of each data column in Detail Band, which is not required. Resolving the problem with the reference method:
1. You can add a text box above the header in the header Band, so that the text box is wide enough to overwrite all data columns, while adjusting the vertical length adjusts the top of the header Band.
2. In the Properties ... window of the text box, clear the display content of the text box is empty, set the background color of the font to the background color of the data window in the Position of the Position of the Font Tab. The Layer is modified to Foreou in the tab, and you can see the effect immediately.