Home Database Mysql Tutorial 【机房收费系统】组合查询

【机房收费系统】组合查询

Jun 07, 2016 pm 04:03 PM
Inquire combination

机房收费系统的组合查询大体上概括一下就是:一个或者多个条件下对信息进行查找,找到了则显示出来,没找到给个提示。说总是简单的,当下手做的时候,分析起来不如说的轻松。 按照程序运行的顺序走 窗体加载: 添加下拉项,设置界面框的可编辑性,让MSFlexGr

机房收费系统的组合查询大体上概括一下就是:一个或者多个条件下对信息进行查找,找到了则显示出来,没找到给个提示。说总是简单的,当下手做的时候,分析起来不如说的轻松。大笑\

按照程序运行的顺序走

窗体加载:

添加下拉项,设置界面框的可编辑性,让MSFlexGrid控件显示标题。

\

组合界面:

窗体加载的时候,只有第一行是可操作的。那么要想让下面的能够操作怎么办呢?

这就需要我们用代码编辑组合关系的组合框。如果组合关系中有内容的话,让对应的下一行能都操作,这两行就会在查询的时候产生组合关系。第三行也一样。

\

学生基本信息维护,那么涉及到的数据库表就是学生表即Student表。

我们在字段名的组合框中添加的下拉项都是汉语的,如果要想作为一个条件进行查找的话,那么它必须能够被数据库所识别。所以这里就需要一个函数将字段名组合框中的每一个汉语内容对应到数据库中字段名的英文单词。同样组合关系组合框中的汉语内容也需要定义一个函数转变成数据库和计算机能够识别的语言。

例如关系组合框:

<span style="font-size:18px;">&#39;定义一个函数将汉字的组合关系转化为计算机语言,数据库能够识别。
Private Function GetString(logiczuhe As String) As String
    Select Case logiczuhe
        Case "或"<span style="white-space:pre">			</span>&#39;当输入框的内容是或的时候,表示组合框的Text属性经过函数变化后传进来的是"or"
            GetString = "or"
        Case "与"
            GetString = "and"
    End Select
End Function</span>
Copy after login

最后看三层关系

分为三层,我们一层一层的来

如果第二行和第三行字段名组合框不可编辑。

我们保证第一行的所有条件内容不能为空。

定义一条SQL语句,把界面上选择的条件都添加到SQL语句当中,然后执行这条SQL语句

在Student表中遍历,看是否有符合该语句的内容。

如果没有,

那么第一行的所有内容清空,焦点给第一个需要输入内容的框中。等待重新输入。

如果有

用一个循环语句,将每一条满足的记录都显示到MSFlexGrid控件中。

这时候,我们的第一层查询就算是结束了。

如果选择了第一个组合关系的组合框,那么第二行就会处于编辑状态。

这是我们做一个判断,如果第三行字段名组合框不可编辑,那么

保证第一行和第二行的内容都不能为空。

定义一个SQL语句,把第一个行的条件和第二行的条件以及两行条件的组合关系都添加到从Student表中查找信息的SQL语句。然后执行该SQL语句

在Student表中遍历,看是否符合该语句的内容

如果没有,

给出提示。不用清空所有的信息框。

如果有

用一个循环语句,将满足这两行条件的记录都显示到MSFlexGrid控件中,两层查询就结束了

第三层查询不同之处就是SQL语句中又多了一行需要满足的条件。

其他跟两层类似。

有了思路,代码部分大多都是都是重复的,有的时候我们分析的会感觉一团浆糊,这时候我们要学会交流,把自己的想法说给自己的同学,师父,也许通过这样的交流,能够收获到让自己豁然开朗的结果。要有耐心去分析,这是一个需要静心的过程。


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to check your academic qualifications on Xuexin.com How to check your academic qualifications on Xuexin.com Mar 28, 2024 pm 04:31 PM

How to check my academic qualifications on Xuexin.com? You can check your academic qualifications on Xuexin.com, but many users don’t know how to check their academic qualifications on Xuexin.com. Next, the editor brings you a graphic tutorial on how to check your academic qualifications on Xuexin.com. Interested users come and take a look! Xuexin.com usage tutorial: How to check your academic qualifications on Xuexin.com 1. Xuexin.com entrance: https://www.chsi.com.cn/ 2. Website query: Step 1: Click on the Xuexin.com address above to enter the homepage Click [Education Query]; Step 2: On the latest webpage, click [Query] as shown by the arrow in the figure below; Step 3: Then click [Login Academic Credit File] on the new page; Step 4: On the login page Enter the information and click [Login];

12306 How to check historical ticket purchase records How to check historical ticket purchase records 12306 How to check historical ticket purchase records How to check historical ticket purchase records Mar 28, 2024 pm 03:11 PM

Download the latest version of 12306 ticket booking app. It is a travel ticket purchasing software that everyone is very satisfied with. It is very convenient to go wherever you want. There are many ticket sources provided in the software. You only need to pass real-name authentication to purchase tickets online. All users You can easily buy travel tickets and air tickets and enjoy different discounts. You can also start booking reservations in advance to grab tickets. You can book hotels or special car transfers. With it, you can go where you want to go and buy tickets with one click. Traveling is simpler and more convenient, making everyone's travel experience more comfortable. Now the editor details it online Provides 12306 users with a way to view historical ticket purchase records. 1. Open Railway 12306, click My in the lower right corner, and click My Order 2. Click Paid on the order page. 3. On the paid page

How to check the activation date on Apple mobile phone How to check the activation date on Apple mobile phone Mar 08, 2024 pm 04:07 PM

If you want to check the activation date using an Apple mobile phone, the best way is to check it through the serial number in the mobile phone. You can also check it by visiting Apple's official website, connecting it to a computer, and downloading third-party software to check it. How to check the activation date of Apple mobile phone Answer: Serial number query, Apple official website query, computer query, third-party software query 1. The best way for users is to know the serial number of their mobile phone. You can see the serial number by opening Settings, General, About This Machine. . 2. Using the serial number, you can not only know the activation date of your mobile phone, but also check the mobile phone version, mobile phone origin, mobile phone factory date, etc. 3. Users visit Apple's official website to find technical support, find the service and repair column at the bottom of the page, and check the iPhone activation information there. 4. User

How to use Oracle to query whether a table is locked? How to use Oracle to query whether a table is locked? Mar 06, 2024 am 11:54 AM

Title: How to use Oracle to query whether a table is locked? In Oracle database, table lock means that when a transaction is performing a write operation on the table, other transactions will be blocked when they want to perform write operations on the table or make structural changes to the table (such as adding columns, deleting rows, etc.). In the actual development process, we often need to query whether the table is locked in order to better troubleshoot and deal with related problems. This article will introduce how to use Oracle statements to query whether a table is locked, and give specific code examples. To check whether the table is locked, we

Comparison of similarities and differences between MySQL and PL/SQL Comparison of similarities and differences between MySQL and PL/SQL Mar 16, 2024 am 11:15 AM

MySQL and PL/SQL are two different database management systems, representing the characteristics of relational databases and procedural languages ​​respectively. This article will compare the similarities and differences between MySQL and PL/SQL, with specific code examples to illustrate. MySQL is a popular relational database management system that uses Structured Query Language (SQL) to manage and operate databases. PL/SQL is a procedural language unique to Oracle database and is used to write database objects such as stored procedures, triggers and functions. same

How to check the latest price of Tongshen Coin? How to check the latest price of Tongshen Coin? Mar 21, 2024 pm 02:46 PM

How to check the latest price of Tongshen Coin? Token is a digital currency that can be used to purchase in-game items, services, and assets. It is decentralized, meaning it is not controlled by governments or financial institutions. Transactions of Tongshen Coin are conducted on the blockchain, which is a distributed ledger that records the information of all Tongshen Coin transactions. To check the latest price of Token, you can use the following steps: Choose a reliable price check website or app. Some commonly used price query websites include: CoinMarketCap: https://coinmarketcap.com/Coindesk: https://www.coindesk.com/ Binance: https://www.bin

Discuz database location query skills sharing Discuz database location query skills sharing Mar 10, 2024 pm 01:36 PM

Forum is one of the most common website forms on the Internet. It provides users with a platform to share information, exchange and discuss. Discuz is a commonly used forum program, and I believe many webmasters are already very familiar with it. During the development and management of the Discuz forum, it is often necessary to query the data in the database for analysis or processing. In this article, we will share some tips for querying the location of the Discuz database and provide specific code examples. First, we need to understand the database structure of Discuz

How to combine two graphics in PPT How to combine two graphics in PPT Mar 20, 2024 pm 05:00 PM

Hello everyone, today I will share with my friends the specific steps of how to combine two graphics in PPT. If you follow these steps, you will learn the operation step by step, and you can draw inferences in the future. The details of the steps are below. Friends, come and take a serious look! 1. First, open a PPT document on your computer, and then create a new PPT slide (as shown in the picture below). 2. Next, find [Shape] in the upper menu bar item [Insert], and select the shape to be imported in the drop-down box of the shape (as shown in the red circle in the figure below). 3. Use the insert function of PPT to insert the triangle and circle shapes into the PPT in sequence, and adjust the size and position of the shapes (as shown by the red arrow in the picture below). 4

See all articles