⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.cpp

📁 《C++Builder数据库程序设计》配书光盘 1.光盘内容 Readme.txt 光盘使用说明 书中各章范例文件
💻 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 + -