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

📄 customserach.cpp

📁 机器须安装SQL Server2000 程序安装完之后
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "CustomSerach.h"
#include "DataMoudle.h"
#include "Main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TCustomSearchForm *CustomSearchForm;
//---------------------------------------------------------------------------
__fastcall TCustomSearchForm::TCustomSearchForm(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TCustomSearchForm::BtnSearchClick(TObject *Sender)
{
    if(RadioButton1->Checked == true)
    {
        ADOQueryTemp->Active = false;
        ADOQueryTemp->SQL->CommaText="select * from custom where name="+QuotedStr(ComboBox1->Text);
        ADOQueryTemp->Active = true;
    }
     if(RadioButton2->Checked == true)
    {
        ADOQueryTemp->Active = false;
        ADOQueryTemp->SQL->CommaText = "select * from custom where Province="+QuotedStr(ComboBox1->Text);
        ADOQueryTemp->Active = true;
    }

}
//---------------------------------------------------------------------------


void __fastcall TCustomSearchForm::FormClose(TObject *Sender,
      TCloseAction &Action)
{
    Action = caFree;
    MainForm->CustomSearch = 0;
}
//---------------------------------------------------------------------------


void __fastcall TCustomSearchForm::RadioButton2Click(TObject *Sender)
{
     ADOQueryPro->Active = true;
        while ( !ADOQueryPro->Eof )
        {
            ComboBox1->Items->Add( ADOQueryPro->FieldByName( "Province" )->AsString );
            ADOQueryPro->Next();
        }
        ADOQueryPro->Active = false;
}
//---------------------------------------------------------------------------

void __fastcall TCustomSearchForm::RadioButton1Click(TObject *Sender)
{
    ComboBox1->Items->Clear();
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -