C++快速开发例子1--ADO之Shape

C++快速开发例子1--ADO之Shape,第1张

1. Form设计

 

2. 源码

//---------------------------------------------------------------------------
#include
#pragma hdrstop

#include "ShapeMain.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TShapeForm *ShapeForm;
//---------------------------------------------------------------------------
__fastcall TShapeForm::TShapeForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TShapeForm::OpenButtonClick(TObject *Sender)
{
  const String ConnStr = "Provider=%s;Data Provider=%s;Data Source=%s";
  if (!ADOConnection1->Connected)
    {
      ADOConnection1->ConnectionString = Format (ConnStr, ARRAYOFCONST(((String)Provider->Text,
        (String)DataProvider->Text, (String)DataSource->Text)));
      Customers->Open();
      Orders->Open();
    }

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

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1324023.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-12
下一篇2022-06-12

发表评论

登录后才能评论

评论列表(0条)

    保存