📄 unit1.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
///宣告装载SQL命令叙述的字符串变量
AnsiString musql;
//建立基本的SQL命令内容
musql="Select * from 成绩单 order by ";
//取消数据库的连接
ADOQuery1->Close();
//清除原本所使用SQL命令
ADOQuery1->SQL->Clear();
//串接新的SQL命令
ADOQuery1->SQL->Add(musql+ComboBox1->Text);
//重新建立数据库连接
ADOQuery1->Open();
//将目前使用的SQL命令内容显示在标题栏
Caption=ADOQuery1->SQL->Text;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -