Collection of application skills of Sybase databas

2022-09-21
  • Detail

PB development Sybase database application skills Collection

PowerBuilder (PB) is a cross platform and powerful development tool with excellent performance. In the application mode of client/server system structure, as an object-oriented visual design tool of client, it is widely used in the system connected with database. In the process of using PB to develop Sybase database application and establish enterprise management information system, the author has accumulated some experience and skills. Now I will introduce some of them here, which may be a little inspiration and help to friends

I. connection between PowerBuilder and Sybase SQL Server

if there is a problem when connecting, you must think calmly and more. First, check the condition of the client to confirm that the open client has been installed and configured correctly. Note that the lithium salt processing project started last year is also proceeding as planned, meaning that the open client must be 32-bit or 16 bit with PowerBuilder

pb cannot be connected with Sybase. Several common error phenomena and handling methods are described as follows:

1 The Sybase database is connected, but the user-defined table cannot be seen in the database drawing board of Pb

at this time, you can open ISQL or Sybase advantage, log in to the "master" database with "Sa", and execute the L script file (which is located in the server directory of the Pb installation disk). It is worth mentioning that we should pay attention to the version number of Sybase adaptive server, and make some changes to some related items according to the data

2. When you open PB's project or library, an error message appears: "cannot locate source management DLL"

this problem is because the interface for installing version control software (such as PVCs) was selected when installing Pb. In fact, the corresponding version control software was not installed on the user's machine

solution: in Pb setting, remove the interface of version control software. The specific operation steps are as follows: in the I file, find the [library] section and put "sourcevendor=..." This line of comments is removed

3. The database connection is normal, but when opening the user table, if there are Chinese characters in the table, there will be garbled codes

this problem is usually caused by the inconsistency between the default character set setting of the client and the character set setting of the server. You should modify the T File (this file is located in the locales subdirectory of the Sybase installation directory). Under windows95/98 operating system, relevant contents under [nt] section can be modified

if the operating system platform is windows3 x. Then modify the content under the [win3] section. A line of text in this section is locale = default, us_ english,is0_ 1, the default character set of the client is set to ISO_ 1。 Developing Chinese management information system can be said to be microcomputer operation. It is generally recommended to change the character set to cp85o, and corresponding adjustments must be made on the server side

II. Some skills of Pb programming

1 Realize the automatic folding of data columns in DataWindow

One of the reasons why Pb software is popular in the market is that its data window function is very strong and easy to use

when using DataWindow, we often encounter that the data of a column is too long to display all at the same time. If automatic horizontal scrolling is adopted, the operation is not simple enough. There is a method to realize multi row display of column data (automatic line folding). The specific steps are as follows:

① Open this window in DataWindow panter, which has a very low proportion in China in order to better use the experimental machine data for the majority of users. Double click the mouse on the column that needs to be set with automatic line folding to open the attribute window of this column. Click the position tab and select the autosize height checkbox; Then select the edit tab and uncheck the auto horzscroll multi selection box; Click the OK button to save the changes

②. Click the detail band (that is, the long gray band with detail written on it), right-click and select Properties Menu item, select the autosize height multi selection box, and click OK to save the changes

2. Use the Enter key instead of the tab key to move between fields in the DataWindow

the basic method is: select the data window, define a user event, and in the pop-up user event definition window, match the event ID with PBM_ Dwnprocessenter, add the following two lines of statements to the script of this event:

send (handle (this), 256,9 long (0,0)) (send a message to the system to process the tab key)

return 1 (ignore the default processing of the Enter key)

3 When using grid data window mode, avoid table lines above the header

tabular report output can be achieved by using the grid data window method, but if it is not controlled or processed above the header, the table lines of each data column in the detail band will appear, which we do not need. The reference method to solve the problem is:

① You can add a text box above the header in the header band, so that the text box is wide enough to cover all data columns, and adjust the vertical length to make the upper part of the header in the header band flush

②. In the properties of the text box In the window, clear the display content of the text box, set the background color of the font to be the same as the background color of the data window in the Font tab, and change its layer to forward in the position tab. Click OK to see the effect immediately. (end)

Copyright © 2011 JIN SHI