How to realize data fuzzy query in PB

Source: Internet
Author: User

This paper mainly introduces how to make fuzzy query of data window according to the fields in the Data window in PB. The code examples for this system are demonstrated using power Builder6.5.

Code and Design:

1. Create a new window, named W_query. Put a data window control in the window, named Dw_master. Put a data window in the Dw_master, and place a button named Cb_query. See figure below:

2. A new structure (structure) is named Str_result_column, and its parameters are as follows:

3. Add two user events in Dw_master, named Ue_action_query, Ue_action_refresh.

4. Add the following code in the Cb_query:

5. Add the following code to the Open event in the window:

dw_master.setTransObject(sqlca)

6. Add the following code to the ue_action_query of Dw_master:

str_result_column lstr_1
//结构str_result_column的成员adw_result指查询结果所产生作用的dw
// 成员adw_column指在本窗口查询条件所要显示的dw
lstr_1.adw_result = this
lstr_1.adw_column = this
OpenWithParm(wroot_dw_query, lstr_1)
7. Add the following code to the Ue_action_refresh event in Dw_master:

dw_master.retrieve()

8. Create a new window named Wroot_dw_query, which is used for fuzzy queries. After its design is complete, the interface is as follows:

Where the "execute" button named "Cb_exec", "return" button named "Cb_exit", "return" button under the data window named Dw_column, its DataObject is d_column_set, the middle of the data window named Dw_where, Its DataObject is d_where.

9. The D_column_set design interface is as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.