BCB6.0连接SQL Server2000

 /*database devlop with bcb6.0
config :
database: sql server 2000
link方式: ODBC+BDE+Database控件
chinanetboy
*/
//说明:borland C++  builder6.0 建立一个简单的数据库应用代码与文件组织
/*main.cpp
//main project
Hrm.bpr
//all form file
Main.dfm,db.dfm
DepInfo.dfm,DepManage.dfm,PeopleManage.dfm,PeopleQuery.dfm,
Prize.dfm,Punish.dfm,SalaryHis.dfm,SalaryManage.dfm,TaxInfo.dfm

//all head file
Main.h,db.h
DepInfo.h,DepManage.h,PeopleManage.h,PeopleQuery.h,
Prize.h,Punish.h,SalaryHis.h,SalaryManage.h,TaxInfo.h

//all cpp file
Main.cpp,db.cpp
DepInfo.cpp,DepManage.cpp,PeopleManage.cpp,PeopleQuery.cpp
,Prize.cpp,Punish.cpp,SalaryHis.cpp,SalaryManage.cpp,TaxInfo.cpp
*/
//--------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "Main.h"
#include "DepManage.h"
#include "DepInfo.h"
#include "PeopleManage.h"
#include "PeopleQuery.h"
#include "SalaryManage.h"
#include "Taxinfo.h"
#include "SalaryHis.h"
#include "Prize.h"
#include "Punish.h"

//--------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TfmMain *fmMain;
//
//--------------------------------------------------------------------
__fastcall TfmMain::TfmMain(TComponent* Owner)
    : TForm(Owner)
{         }
//--------------------------------------------------------------------
TForm* TfmMain::FormExist(AnsiString szCaption)
{
    for(int i=0; i<this->MDIChildCount; i++)
    {
        TForm *pForm = this->MDIChildren[i];
        if(pForm->Caption == szCaption)
            return pForm;   // 已存在窗体,返回该窗体
    }
    return NULL;    // 不存在窗体,返回空值
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuDepManageClick(TObject *Sender)
{
    // 显示机构设置及编码窗体
    TForm *pForm = FormExist("机构设置");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmDepManage(Application);
    pForm->Show();
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuDepInfoClick(TObject *Sender)
{
    // 显示机构详细信息窗体
    TForm *pForm = FormExist("机构详细信息");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmDepInfo(Application);
    pForm->Show();
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuPeopleManageClick(TObject *Sender)
{
    // 显示职员信息维护窗体
    TForm *pForm = FormExist("职员信息管理");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmPeopleManage(Application);
    pForm->Show();
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuPeopleQueryClick(TObject *Sender)
{
    // 显示职员信息查询窗体
    TForm *pForm = FormExist("职员信息查询");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmPeopleQuery(Application);
    pForm->Show();
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuSalaryManageClick(TObject *Sender)
{
    // 显示当月工资管理窗体
    TForm *pForm = FormExist("当月工资管理");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmSalaryManage(Application);
    pForm->Show();
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuTaxInfoClick(TObject *Sender)
{
    // 显示个人所得税率窗体
    TForm *pForm = FormExist("个人所得税率");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmTaxInfo(Application);
    pForm->Show();
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuSalaryHisClick(TObject *Sender)
{
    // 显示工资发放历史窗体
    TForm *pForm = FormExist("工资发放历史");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmSalaryHis(Application);
    pForm->Show();
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuPrizeClick(TObject *Sender)
{
    // 显示职员奖励管理窗体
    TForm *pForm = FormExist("职员奖励管理");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmPrize(Application);
    pForm->Show();
}
//--------------------------------------------------------------------
void __fastcall TfmMain::mnuPunishClick(TObject *Sender)
{
    // 显示职员惩罚管理窗体
    TForm *pForm = FormExist("职员惩罚管理");
    // 如果已存在则激活,否则新建一个字窗体
    if(pForm)
        pForm->SetFocus();
    else
        pForm = new TfmPunish(Application);
    pForm->Show();
}
//--------------------------------------------------------------------

你可能感兴趣的:(BCB6.0连接SQL Server2000)