Talking about PB Use Experience (1) (Original)

xiaoxiao2021-03-06  34

Talking about PB Use Experience (1) (Original)

Author: BALLOONMAN2002 2004 Nian 6 Yue 26 Ri

This article intends to combine some of the personalbuilder language, talking about some of the experience in the development of PB development, these are not ingenious, focus on some basic knowledge and neglect point summary:

First, how to use good PB help

A lot of new learning PB friends always want to find a good PB tutorial. In fact, I think PB's own PB help is the best online PB tutorial. It system, comprehensive coverage, statement, statement, all kinds Functions, various objects, built-in controls, DWO details, data interfaces to PFC deep applications, are not only classified, but also in place, model examples. In addition, the index function of itself is also very detailed. The only shortcomings are not like MSDN. But this does not affect its facts as the most classic PB tutorial, I personally strongly recommend new PB friends to learn from the beginning, :), the content described in this article is just in the PB help. Some scattered knowledge is organized, and the detailed information can be further referred to the relevant help.

In addition, PB comes with DWSYNTAX, Code Examples is also a very good case tool.

Second, how to dynamically modify the data source of DataWindow Object

(1) Implementing the setsqlselect function by getSqlselect

DWControl.getsqlselect ()

DWControl.setsqlselect (statement)

Note: This situation requires the result of the new Old SELECT to be consistent, and the SELECT statement does not have Retrieve Arguments.

(2) Implementation through dw_control.object.dataWindow.Table.Select property

SQLVAR = 'SELECT ... WHERE ...'

DW_1.Modify ("DataWindow.Table.Select = ' SQLVAR " ")

Note: This situation can be used to use Retrieve Arguments, but you must only use the original defined Arguments.

(3) Reconstructing DataWindow by Create Function

DWControl.create (Syntax {, ErrorBuffer})

The syntax syntax of this can be obtained by following four ways:

1, setting = dw_1.object.dataWindow.syntax

Setting = dw_1.describe ("DataWindow.SYNTAX")

2, LibraryExport (libraryname, objectname, objecttype)

3, Transaction.Syntaxfromsql (Sqlselect, Presentation, ERR)

4, combined with Syntax, but this requires developers very familiar with DWO object syntax

(4) Implementing part of the data by the setfilter function

DWControl.SetFilter (Format)

This method is actually an indirect method for the purpose.

(5) Implementation by handling SQLPReView events

This method is also a method that reaches the purpose, which enables the modification of the data source by changing the SQLSYNTAX parameters in the SQLPReView event.

Third, common error handling method

(1) For errors caused by SQL statement operations, typically detect: sqlca.sqlcode: Sqlca.sqlcode: Sqlca.sqlcode: Sqlca.sqlcode:

Value meaning

0 Success

100 fetched row not found

-1 Error; The Statement Faled. Use sqlerrtext or sqldbcode to obtain the detail.

Indicator Variables:

0 Valid, Non-Null Value

-1 Null Value

-2 Conversion Error

(2) For other system errors, you need to handle ERROR, DBERROR, ITEMERROR, SYSTEMERROR, etc., if it is PB9, you can use: try ... catch ... finally ... END TRY statement

.........

This article has not been continued

.........

For further information, please contact QQ: 27855043, MSN: weiyin2001@msn.com

If you have something wrong, you respect your guidance.

转载请注明原文地址:https://www.9cbs.com/read-65012.html

New Post(0)